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 CommandHistory = @import("./CommandHistory.zig");
|
||||||
const TaskStore = @import("./TaskStore.zig");
|
const TaskStore = @import("./TaskStore.zig");
|
||||||
|
|
||||||
|
///
|
||||||
const Self = @This();
|
const Self = @This();
|
||||||
|
|
||||||
tasks: TaskStore,
|
///
|
||||||
|
const Perma = struct {
|
||||||
|
tasks: TaskStore,
|
||||||
|
};
|
||||||
|
|
||||||
|
///
|
||||||
commands: CommandHistory,
|
commands: CommandHistory,
|
||||||
|
|
||||||
|
///
|
||||||
|
perma: Perma,
|
||||||
|
|
||||||
|
///
|
||||||
pub fn init(allocator: std.mem.Allocator) Self {
|
pub fn init(allocator: std.mem.Allocator) Self {
|
||||||
return Self {
|
return Self {
|
||||||
.commands = CommandHistory.init(allocator),
|
.commands = CommandHistory.init(allocator),
|
||||||
.tasks = TaskStore.init(allocator),
|
.perma = .{
|
||||||
|
.tasks = TaskStore.init(allocator),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
pub fn deinit(self: *Self) void {
|
pub fn deinit(self: *Self) void {
|
||||||
self.tasks.deinit();
|
self.perma.tasks.deinit();
|
||||||
|
self.commands.deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
var ws = init(std.testing.allocator);
|
var ws = init(std.testing.allocator);
|
||||||
defer ws.deinit();
|
defer ws.deinit();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user