Remove shrink_to_fit from default ToString::to_string implementation.

Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
This commit is contained in:
Mara Bos 2020-10-15 23:36:26 +02:00
parent ccea570488
commit 0b062887db
1 changed files with 0 additions and 1 deletions

View File

@ -2200,7 +2200,6 @@ impl<T: fmt::Display + ?Sized> ToString for T {
let mut buf = String::new();
buf.write_fmt(format_args!("{}", self))
.expect("a Display implementation returned an error unexpectedly");
buf.shrink_to_fit();
buf
}
}