about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobin Schoonover <robin@cornhooves.org>2020-10-04 15:53:37 -0600
committerRobin Schoonover <robin@cornhooves.org>2020-10-04 15:53:37 -0600
commitf34f4a732714c397c30055feddb2b520b6acd38e (patch)
treef4ab5aae08fa6f55b5f932123d0f34f887082fb4
parent840f7daaadb1222c4355dbb72cabdcf912cb8877 (diff)
downloadrust-f34f4a732714c397c30055feddb2b520b6acd38e.tar.gz
rust-f34f4a732714c397c30055feddb2b520b6acd38e.zip
Change clippy's Constant back to refcount clone byte strings
-rw-r--r--clippy_lints/src/consts.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/consts.rs b/clippy_lints/src/consts.rs
index 0000d39263e..062c9bd2d9e 100644
--- a/clippy_lints/src/consts.rs
+++ b/clippy_lints/src/consts.rs
@@ -155,7 +155,7 @@ pub fn lit_to_constant(lit: &LitKind, ty: Option<Ty<'_>>) -> Constant {
     match *lit {
         LitKind::Str(ref is, _) => Constant::Str(is.to_string()),
         LitKind::Byte(b) => Constant::Int(u128::from(b)),
-        LitKind::ByteStr(ref s) => Constant::Binary(Lrc::from(s.as_slice())),
+        LitKind::ByteStr(ref s) => Constant::Binary(Lrc::clone(s)),
         LitKind::Char(c) => Constant::Char(c),
         LitKind::Int(n, _) => Constant::Int(n),
         LitKind::Float(ref is, LitFloatType::Suffixed(fty)) => match fty {