btree/rangemap: CamelCase the error names
This commit is contained in:
+3
-3
@@ -16,7 +16,7 @@ pub fn BTree(comptime N: type, comptime compare_fn: CompareFn(N), comptime deini
|
||||
gpa: Allocator,
|
||||
root: ?*Node = null,
|
||||
|
||||
pub const Error = error{ already_exists, does_not_exist } || Allocator.Error;
|
||||
pub const Error = error{ AlreadyExists, DoesNotExist } || Allocator.Error;
|
||||
|
||||
pub fn WalkFn(comptime C: type) type {
|
||||
return fn (*const Node, C) void;
|
||||
@@ -94,7 +94,7 @@ pub fn BTree(comptime N: type, comptime compare_fn: CompareFn(N), comptime deini
|
||||
child.parent = n;
|
||||
n.left = child;
|
||||
},
|
||||
.eq => return error.already_exists,
|
||||
.eq => return error.AlreadyExists,
|
||||
}
|
||||
return .{ n, inserted };
|
||||
} else {
|
||||
@@ -161,7 +161,7 @@ pub fn BTree(comptime N: type, comptime compare_fn: CompareFn(N), comptime deini
|
||||
}
|
||||
return node;
|
||||
} else {
|
||||
return error.does_not_exist;
|
||||
return error.DoesNotExist;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ test "Range map insertion" {
|
||||
_ = try map.insert(0, 10, "Range 1");
|
||||
_ = try map.insert(20, 10, "Range 3");
|
||||
|
||||
try std.testing.expectError(error.already_exists, map.insert(5, 10, "Invalid range"));
|
||||
try std.testing.expectError(error.AlreadyExists, map.insert(5, 10, "Invalid range"));
|
||||
|
||||
_ = try map.insert(1000, 10, "Range 4");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user