From 47c4d4450281bfddebf89cbad4f9c1fdcc7b0b65 Mon Sep 17 00:00:00 2001 From: Mikael Berthe Date: Mon, 13 Jun 2022 17:19:37 +0200 Subject: [PATCH] std.math.big.int: update Managed.toString() to use provided allocator (#11839) --- lib/std/math/big/int.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/std/math/big/int.zig b/lib/std/math/big/int.zig index 170272f287..661d370419 100644 --- a/lib/std/math/big/int.zig +++ b/lib/std/math/big/int.zig @@ -2593,9 +2593,8 @@ pub const Managed = struct { /// Converts self to a string in the requested base. Memory is allocated from the provided /// allocator and not the one present in self. pub fn toString(self: Managed, allocator: Allocator, base: u8, case: std.fmt.Case) ![]u8 { - _ = allocator; if (base < 2 or base > 16) return error.InvalidBase; - return self.toConst().toStringAlloc(self.allocator, base, case); + return self.toConst().toStringAlloc(allocator, base, case); } /// To allow `std.fmt.format` to work with `Managed`.