File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ fn scan_escape<T: From<u8> + From<char>>(
222
222
mode : Mode ,
223
223
) -> Result < T , EscapeError > {
224
224
// Previous character was '\\', unescape what follows.
225
- let res = match chars. next ( ) . ok_or ( EscapeError :: LoneSlash ) ? {
225
+ let res: u8 = match chars. next ( ) . ok_or ( EscapeError :: LoneSlash ) ? {
226
226
'"' => b'"' ,
227
227
'n' => b'\n' ,
228
228
'r' => b'\r' ,
@@ -249,10 +249,10 @@ fn scan_escape<T: From<u8> + From<char>>(
249
249
value as u8
250
250
}
251
251
252
- 'u' => return scan_unicode ( chars, mode. is_unicode_escape_disallowed ( ) ) . map ( Into :: into ) ,
252
+ 'u' => return scan_unicode ( chars, mode. is_unicode_escape_disallowed ( ) ) . map ( T :: from ) ,
253
253
_ => return Err ( EscapeError :: InvalidEscape ) ,
254
254
} ;
255
- Ok ( res . into ( ) )
255
+ Ok ( T :: from ( res ) )
256
256
}
257
257
258
258
fn scan_unicode (
@@ -366,7 +366,7 @@ where
366
366
}
367
367
'"' => Err ( EscapeError :: EscapeOnlyChar ) ,
368
368
'\r' => Err ( EscapeError :: BareCarriageReturn ) ,
369
- _ => ascii_check ( c, chars_should_be_ascii) . map ( Into :: into ) ,
369
+ _ => ascii_check ( c, chars_should_be_ascii) . map ( T :: from ) ,
370
370
} ;
371
371
let end = src. len ( ) - chars. as_str ( ) . len ( ) ;
372
372
callback ( start..end, res) ;
You can’t perform that action at this time.
0 commit comments