Skip to content

Commit 0b06288

Browse files
m-ou-sescottmcm
andcommitted
Remove shrink_to_fit from default ToString::to_string implementation.
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
1 parent ccea570 commit 0b06288

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

library/alloc/src/string.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2200,7 +2200,6 @@ impl<T: fmt::Display + ?Sized> ToString for T {
22002200
let mut buf = String::new();
22012201
buf.write_fmt(format_args!("{}", self))
22022202
.expect("a Display implementation returned an error unexpectedly");
2203-
buf.shrink_to_fit();
22042203
buf
22052204
}
22062205
}

0 commit comments

Comments
 (0)