File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 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>>(
222222 mode : Mode ,
223223) -> Result < T , EscapeError > {
224224 // 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 ) ? {
226226 '"' => b'"' ,
227227 'n' => b'\n' ,
228228 'r' => b'\r' ,
@@ -249,10 +249,10 @@ fn scan_escape<T: From<u8> + From<char>>(
249249 value as u8
250250 }
251251
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 ) ,
253253 _ => return Err ( EscapeError :: InvalidEscape ) ,
254254 } ;
255- Ok ( res . into ( ) )
255+ Ok ( T :: from ( res ) )
256256}
257257
258258fn scan_unicode (
@@ -366,7 +366,7 @@ where
366366 }
367367 '"' => Err ( EscapeError :: EscapeOnlyChar ) ,
368368 '\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 ) ,
370370 } ;
371371 let end = src. len ( ) - chars. as_str ( ) . len ( ) ;
372372 callback ( start..end, res) ;
You can’t perform that action at this time.
0 commit comments