diff --git a/src/lib.zig b/src/lib.zig index e9b876240919d39b0ce5dd3ae5a2e7853d8161a4..4b26058d61f7a3603440aec29b89e48defea2ed1 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -34,7 +34,7 @@ pub fn addSentinel(alloc: *std.mem.Allocator, comptime T: type, input: []const T const alphabet = "0123456789abcdefghijklmnopqrstuvwxyz"; -pub fn randomSlice(alloc: *std.mem.Allocator, rand: *std.rand.Random, comptime T: type, len: usize) ![]const T { +pub fn randomSlice(alloc: *std.mem.Allocator, rand: *std.rand.Random, comptime T: type, len: usize) ![]T { var buf = try alloc.alloc(T, len); var i: usize = 0; while (i < len) : (i += 1) { @@ -56,7 +56,7 @@ pub fn base64EncodeAlloc(alloc: *std.mem.Allocator, input: string) !string { return base64.encode(buf, input); } -pub fn asciiUpper(alloc: *std.mem.Allocator, input: string) !string { +pub fn asciiUpper(alloc: *std.mem.Allocator, input: string) ![]u8 { var buf = try alloc.dupe(u8, input); for (range(buf.len)) |_, i| { buf[i] = std.ascii.toUpper(buf[i]);