about summary refs log tree commit diff
path: root/library/alloc/src/string.rs
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2020-10-15 23:36:26 +0200
committerMara Bos <m-ou.se@m-ou.se>2020-10-16 11:15:12 +0200
commit0b062887db9be8fe05791411dd08ca35683cedc8 (patch)
treed2e0625690df7a37d070e3960d68e34a94da7fad /library/alloc/src/string.rs
parentccea570488694e502c1a7ca8f3f0866c9b763ce4 (diff)
downloadrust-0b062887db9be8fe05791411dd08ca35683cedc8.tar.gz
rust-0b062887db9be8fe05791411dd08ca35683cedc8.zip
Remove shrink_to_fit from default ToString::to_string implementation.
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
Diffstat (limited to 'library/alloc/src/string.rs')
-rw-r--r--library/alloc/src/string.rs1
1 files changed, 0 insertions, 1 deletions
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs
index d3598ccfce8..dc67d903a1d 100644
--- a/library/alloc/src/string.rs
+++ b/library/alloc/src/string.rs
@@ -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
     }
 }