feat: add reload_file command
This commit is contained in:
parent
9892e693b0
commit
4aca7063f2
2 changed files with 10 additions and 0 deletions
|
@ -1257,6 +1257,11 @@ pub fn reset_to_last_saved(self: *Self) void {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn refresh_from_file(self: *Self) LoadFromFileError!void {
|
||||
try self.load_from_file_and_update(self.file_path);
|
||||
self.update_last_used_time();
|
||||
}
|
||||
|
||||
pub fn store_to_string(self: *const Self, allocator: Allocator, eol_mode: EolMode) ![]u8 {
|
||||
var s = try ArrayList(u8).initCapacity(allocator, self.root.weights_sum().len);
|
||||
try self.root.store(s.writer(), eol_mode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue