refactor(buffers): use explicit errorsets in undo functions
This commit is contained in:
parent
4d3d91a744
commit
649d369a56
1 changed files with 2 additions and 2 deletions
|
@ -1335,13 +1335,13 @@ pub fn update(self: *Self, root: Root) void {
|
||||||
self.mtime = std.time.milliTimestamp();
|
self.mtime = std.time.milliTimestamp();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn store_undo(self: *Self, meta: []const u8) !void {
|
pub fn store_undo(self: *Self, meta: []const u8) error{OutOfMemory}!void {
|
||||||
self.push_undo(try self.create_undo(self.root, meta));
|
self.push_undo(try self.create_undo(self.root, meta));
|
||||||
self.curr_history = null;
|
self.curr_history = null;
|
||||||
try self.push_redo_branch();
|
try self.push_redo_branch();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_undo(self: *const Self, root: Root, meta_: []const u8) !*UndoNode {
|
fn create_undo(self: *const Self, root: Root, meta_: []const u8) error{OutOfMemory}!*UndoNode {
|
||||||
const h = try self.allocator.create(UndoNode);
|
const h = try self.allocator.create(UndoNode);
|
||||||
const meta = try self.allocator.dupe(u8, meta_);
|
const meta = try self.allocator.dupe(u8, meta_);
|
||||||
h.* = UndoNode{
|
h.* = UndoNode{
|
||||||
|
|
Loading…
Add table
Reference in a new issue