Fix Formatter.print returning incorrect size (#2306)

* Fix `Formatter.print` returning incorrect size
This commit is contained in:
Christian Buttner
2025-07-18 15:54:07 +02:00
committed by GitHub
parent adb3df05c6
commit cf913b41c6
4 changed files with 4 additions and 4 deletions

View File

@@ -69,7 +69,6 @@ struct Formatter
PrintFlags flags;
uint width;
uint prec;
usz idx;
fault first_fault;
}
}
@@ -571,5 +570,5 @@ fn usz? Formatter.print(&self, String str)
self.out_fn = &out_null_fn;
}
foreach (c : str) self.out(c)!;
return self.idx;
return str.len;
}

View File

@@ -660,7 +660,6 @@ fn usz? Formatter.out_char(&self, any arg) @private
fn usz? Formatter.out_reverse(&self, char[] buf) @private
{
usz n;
usz buffer_start_idx = self.idx;
usz len = buf.len;
// pad spaces up to given width
if (!self.flags.zeropad && !self.flags.left)