fix: clean-up bitrot in buffer tests

This commit is contained in:
CJ van den Berg 2024-10-22 19:04:40 +02:00
parent b70da1918c
commit a5ebaf6202
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 41 additions and 33 deletions

View file

@ -1122,9 +1122,9 @@ pub fn load_from_file_and_update(self: *Self, file_path: []const u8) !void {
self.last_save_eol_mode = eol_mode;
}
pub fn store_to_string(self: *const Self, allocator: Allocator) ![]u8 {
pub fn store_to_string(self: *const Self, allocator: Allocator, eol_mode: EolMode) ![]u8 {
var s = try ArrayList(u8).initCapacity(allocator, self.root.weights_sum().len);
try self.root.store(s.writer());
try self.root.store(s.writer(), eol_mode);
return s.toOwnedSlice();
}