File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ pub enum Constant {
21
21
/// A `String` (e.g., "abc").
22
22
Str ( String ) ,
23
23
/// A binary string (e.g., `b"abc"`).
24
- Binary ( Lrc < Vec < u8 > > ) ,
24
+ Binary ( Lrc < [ u8 ] > ) ,
25
25
/// A single `char` (e.g., `'a'`).
26
26
Char ( char ) ,
27
27
/// An integer's bit representation.
@@ -155,7 +155,7 @@ pub fn lit_to_constant(lit: &LitKind, ty: Option<Ty<'_>>) -> Constant {
155
155
match * lit {
156
156
LitKind :: Str ( ref is, _) => Constant :: Str ( is. to_string ( ) ) ,
157
157
LitKind :: Byte ( b) => Constant :: Int ( u128:: from ( b) ) ,
158
- LitKind :: ByteStr ( ref s) => Constant :: Binary ( Lrc :: clone ( s ) ) ,
158
+ LitKind :: ByteStr ( ref s) => Constant :: Binary ( Lrc :: from ( s . as_slice ( ) ) ) ,
159
159
LitKind :: Char ( c) => Constant :: Char ( c) ,
160
160
LitKind :: Int ( n, _) => Constant :: Int ( n) ,
161
161
LitKind :: Float ( ref is, LitFloatType :: Suffixed ( fty) ) => match fty {
You can’t perform that action at this time.
0 commit comments