authorgravatar for mikael@lilotux.netMikael Berthe <mikael@lilotux.net> 2022-06-13 17:19:37+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-06-13 17:19:37+02:00
log47c4d4450281bfddebf89cbad4f9c1fdcc7b0b65
treeba45c454908302bab89e4d632166f5c90ca3a58a
parent7c660d17cde9af6b4c7229a300ff0ccd31317bf3
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

std.math.big.int: update Managed.toString() to use provided allocator (#11839)


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

lib/std/math/big/int.zig+1-2
...@@ -2593,9 +2593,8 @@ pub const Managed = struct {...@@ -2593,9 +2593,8 @@ pub const Managed = struct {
2593 /// Converts self to a string in the requested base. Memory is allocated from the provided2593 /// Converts self to a string in the requested base. Memory is allocated from the provided
2594 /// allocator and not the one present in self.2594 /// allocator and not the one present in self.
2595 pub fn toString(self: Managed, allocator: Allocator, base: u8, case: std.fmt.Case) ![]u8 {2595 pub fn toString(self: Managed, allocator: Allocator, base: u8, case: std.fmt.Case) ![]u8 {
2596 _ = allocator;
2597 if (base < 2 or base > 16) return error.InvalidBase;2596 if (base < 2 or base > 16) return error.InvalidBase;
2598 return self.toConst().toStringAlloc(self.allocator, base, case);2597 return self.toConst().toStringAlloc(allocator, base, case);
2599 }2598 }
26002599
2601 /// To allow `std.fmt.format` to work with `Managed`.2600 /// To allow `std.fmt.format` to work with `Managed`.