Skip to content

Commit d775965

Browse files
committed
Use try_from
1 parent f02f327 commit d775965

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/parser/src/lexer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,12 @@ where
244244
// Detect potential string like rb'' b'' f'' u'' r''
245245
match self.window[..3] {
246246
[Some(c), Some('"' | '\''), ..] => {
247-
if let Ok(kind) = c.to_string().try_into() {
247+
if let Ok(kind) = StringKind::try_from(c.to_string()) {
248248
return self.lex_string(kind);
249249
}
250250
}
251251
[Some(c1), Some(c2), Some('"' | '\'')] => {
252-
if let Ok(kind) = format!("{c1}{c2}").try_into() {
252+
if let Ok(kind) = StringKind::try_from(format!("{c1}{c2}")) {
253253
return self.lex_string(kind);
254254
}
255255
}

0 commit comments

Comments
 (0)