Skip to content

Commit 62f7712

Browse files
committed
Change clippy's Constant back to refcount clone byte strings
1 parent 5ab1967 commit 62f7712

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/clippy/clippy_lints/src/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ pub fn lit_to_constant(lit: &LitKind, ty: Option<Ty<'_>>) -> Constant {
155155
match *lit {
156156
LitKind::Str(ref is, _) => Constant::Str(is.to_string()),
157157
LitKind::Byte(b) => Constant::Int(u128::from(b)),
158-
LitKind::ByteStr(ref s) => Constant::Binary(Lrc::from(s.as_slice())),
158+
LitKind::ByteStr(ref s) => Constant::Binary(Lrc::clone(s)),
159159
LitKind::Char(c) => Constant::Char(c),
160160
LitKind::Int(n, _) => Constant::Int(n),
161161
LitKind::Float(ref is, LitFloatType::Suffixed(fty)) => match fty {

0 commit comments

Comments
 (0)