]> git.lizzy.rs Git - rust.git/commitdiff
Remove unnecessary manual shrink_to_fit calls
authorDániel Buga <bugadani@gmail.com>
Sat, 16 Jan 2021 13:02:36 +0000 (14:02 +0100)
committerDániel Buga <bugadani@gmail.com>
Sat, 16 Jan 2021 13:02:36 +0000 (14:02 +0100)
compiler/rustc_ast/src/util/literal.rs

index 106ffb2a0fdfbddb15866c078885e8ba3d5d0e5e..2124f1efb990c18c472aeb60c3200498a5dbacdc 100644 (file)
@@ -87,7 +87,6 @@ fn from_lit_token(lit: token::Lit) -> Result<LitKind, LitError> {
                             }
                         });
                         error?;
-                        buf.shrink_to_fit();
                         Symbol::intern(&buf)
                     } else {
                         symbol
@@ -105,7 +104,6 @@ fn from_lit_token(lit: token::Lit) -> Result<LitKind, LitError> {
                     }
                 });
                 error?;
-                buf.shrink_to_fit();
                 LitKind::ByteStr(buf.into())
             }
             token::ByteStrRaw(_) => {
@@ -120,7 +118,6 @@ fn from_lit_token(lit: token::Lit) -> Result<LitKind, LitError> {
                         }
                     });
                     error?;
-                    buf.shrink_to_fit();
                     buf
                 } else {
                     symbol.to_string().into_bytes()