std: bigint.deinit() shouldn't need a mutable pointer

This commit is contained in:
daurnimator 2020-02-14 18:59:07 +11:00
parent fb6b94f80f
commit b61e53cc40
No known key found for this signature in database
GPG Key ID: 45B429A8F9D9D22A

View File

@ -137,10 +137,9 @@ pub const Int = struct {
}
/// Frees all memory associated with an Int.
pub fn deinit(self: *Int) void {
pub fn deinit(self: Int) void {
self.assertWritable();
self.allocator.?.free(self.limbs);
self.* = undefined;
}
/// Clones an Int and returns a new Int with the same value. The new Int is a deep copy and