separate permanentized data in workspace
This commit is contained in:
parent
8263ccad82
commit
e30773870f
@ -3,20 +3,36 @@ const std = @import("std");
|
||||
const CommandHistory = @import("./CommandHistory.zig");
|
||||
const TaskStore = @import("./TaskStore.zig");
|
||||
|
||||
///
|
||||
const Self = @This();
|
||||
|
||||
tasks: TaskStore,
|
||||
///
|
||||
const Perma = struct {
|
||||
tasks: TaskStore,
|
||||
};
|
||||
|
||||
///
|
||||
commands: CommandHistory,
|
||||
|
||||
///
|
||||
perma: Perma,
|
||||
|
||||
///
|
||||
pub fn init(allocator: std.mem.Allocator) Self {
|
||||
return Self {
|
||||
.commands = CommandHistory.init(allocator),
|
||||
.tasks = TaskStore.init(allocator),
|
||||
.perma = .{
|
||||
.tasks = TaskStore.init(allocator),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
///
|
||||
pub fn deinit(self: *Self) void {
|
||||
self.tasks.deinit();
|
||||
self.perma.tasks.deinit();
|
||||
self.commands.deinit();
|
||||
}
|
||||
|
||||
test {
|
||||
var ws = init(std.testing.allocator);
|
||||
defer ws.deinit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user