authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-09-12 17:16:05 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-09-12 17:16:05 -07:00
log6b617fc40eb889d5138ab3c00a1f79db7f15385b
tree92129ccbf63449d47376a2ff46c1948d4f2b4d75
parentd95ed8783ba83aa072eb8d6d336b94c7e8167a6d

allow alloc results to be non const and let caller coerce


1 files changed, 2 insertions(+), 2 deletions(-)

src/lib.zig+2-2
......@@ -34,7 +34,7 @@ pub fn addSentinel(alloc: *std.mem.Allocator, comptime T: type, input: []const T
3434
3535const alphabet = "0123456789abcdefghijklmnopqrstuvwxyz";
3636
37pub fn randomSlice(alloc: *std.mem.Allocator, rand: *std.rand.Random, comptime T: type, len: usize) ![]const T {
37pub fn randomSlice(alloc: *std.mem.Allocator, rand: *std.rand.Random, comptime T: type, len: usize) ![]T {
3838 var buf = try alloc.alloc(T, len);
3939 var i: usize = 0;
4040 while (i < len) : (i += 1) {
......@@ -56,7 +56,7 @@ pub fn base64EncodeAlloc(alloc: *std.mem.Allocator, input: string) !string {
5656 return base64.encode(buf, input);
5757}
5858
59pub fn asciiUpper(alloc: *std.mem.Allocator, input: string) !string {
59pub fn asciiUpper(alloc: *std.mem.Allocator, input: string) ![]u8 {
6060 var buf = try alloc.dupe(u8, input);
6161 for (range(buf.len)) |_, i| {
6262 buf[i] = std.ascii.toUpper(buf[i]);