aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-06-30 19:34:21 +0200
committerHimbeer <himbeer@disroot.org>2024-06-30 19:34:21 +0200
commit719a1d73521f3a8ab04a53078d5b4fe7d25335a4 (patch)
treeccaad0f7057041170e8cad32723cab21d21b0ff7
parent94888f4b2cded8b9f7edbc2e442c77dcaebc9c42 (diff)
vfs: Create type alias for Tree nodes
-rw-r--r--src/lib/vfs.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/vfs.zig b/src/lib/vfs.zig
index d3b9014..e1ae252 100644
--- a/src/lib/vfs.zig
+++ b/src/lib/vfs.zig
@@ -42,6 +42,8 @@ pub const Tree = struct {
allocator: std.mem.Allocator,
nodes: std.DoublyLinkedList(Inode),
+ pub const Node = std.DoublyLinkedList(Inode).Node;
+
pub fn init(allocator: std.mem.Allocator) Tree {
return .{
.allocator = allocator,
@@ -50,7 +52,7 @@ pub const Tree = struct {
}
pub fn provideResource(self: *Tree, inode: Inode) !void {
- var node = try self.allocator.create(std.DoublyLinkedList(Inode).Node);
+ var node = try self.allocator.create(Node);
node.data = inode;
self.nodes.append(node);
}