| ... | @@ -34,7 +34,7 @@ pub fn addSentinel(alloc: *std.mem.Allocator, comptime T: type, input: []const T | ... | @@ -34,7 +34,7 @@ pub fn addSentinel(alloc: *std.mem.Allocator, comptime T: type, input: []const T |
| 34 | | 34 | |
| 35 | const alphabet = "0123456789abcdefghijklmnopqrstuvwxyz"; | 35 | const alphabet = "0123456789abcdefghijklmnopqrstuvwxyz"; |
| 36 | | 36 | |
| 37 | pub fn randomSlice(alloc: *std.mem.Allocator, rand: *std.rand.Random, comptime T: type, len: usize) ![]const T { | 37 | pub fn randomSlice(alloc: *std.mem.Allocator, rand: *std.rand.Random, comptime T: type, len: usize) ![]T { |
| 38 | var buf = try alloc.alloc(T, len); | 38 | var buf = try alloc.alloc(T, len); |
| 39 | var i: usize = 0; | 39 | var i: usize = 0; |
| 40 | while (i < len) : (i += 1) { | 40 | while (i < len) : (i += 1) { |
| ... | @@ -56,7 +56,7 @@ pub fn base64EncodeAlloc(alloc: *std.mem.Allocator, input: string) !string { | ... | @@ -56,7 +56,7 @@ pub fn base64EncodeAlloc(alloc: *std.mem.Allocator, input: string) !string { |
| 56 | return base64.encode(buf, input); | 56 | return base64.encode(buf, input); |
| 57 | } | 57 | } |
| 58 | | 58 | |
| 59 | pub fn asciiUpper(alloc: *std.mem.Allocator, input: string) !string { | 59 | pub fn asciiUpper(alloc: *std.mem.Allocator, input: string) ![]u8 { |
| 60 | var buf = try alloc.dupe(u8, input); | 60 | var buf = try alloc.dupe(u8, input); |
| 61 | for (range(buf.len)) |_, i| { | 61 | for (range(buf.len)) |_, i| { |
| 62 | buf[i] = std.ascii.toUpper(buf[i]); | 62 | buf[i] = std.ascii.toUpper(buf[i]); |