We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 866ec24 commit f5f8559Copy full SHA for f5f8559
library/core/src/fmt/mod.rs
@@ -652,8 +652,9 @@ impl<'a> Arguments<'a> {
652
// There are some arguments, so any additional push
653
// will reallocate the string. To avoid that,
654
// we're "pre-doubling" the capacity here.
655
- // It cannot overflow, because the maximum length is `isize::MAX`.
656
- pieces_length * 2
+ pieces_length
+ .checked_add(self.args.len().checked_mul(8).unwrap_or(0))
657
+ .unwrap_or(pieces_length)
658
}
659
660
0 commit comments