From 0b062887db9be8fe05791411dd08ca35683cedc8 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Thu, 15 Oct 2020 23:36:26 +0200 Subject: [PATCH] Remove shrink_to_fit from default ToString::to_string implementation. Co-authored-by: scottmcm --- library/alloc/src/string.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index d3598ccfce81f..dc67d903a1dcc 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -2200,7 +2200,6 @@ impl 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 } }