Skip to content

Commit 4b4e178

Browse files
committed
match -> if let
1 parent dcb7f48 commit 4b4e178

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

src/shell.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,19 @@ fn shell_exec(
5959
Err(err) => {
6060
// Check if the error is from an unclosed triple quoted string (which should always
6161
// continue)
62-
match err {
63-
CompileError::Parse(ParseError {
64-
error: ParseErrorType::Lexical(LexicalErrorType::UnclosedStringError),
65-
raw_location,
66-
..
67-
}) => {
68-
let loc = raw_location.start().to_usize();
69-
let mut iter = source.chars();
70-
if let Some(quote) = iter.nth(loc) {
71-
if iter.next() == Some(quote) && iter.next() == Some(quote) {
72-
return ShellExecResult::ContinueLine;
73-
}
62+
if let CompileError::Parse(ParseError {
63+
error: ParseErrorType::Lexical(LexicalErrorType::UnclosedStringError),
64+
raw_location,
65+
..
66+
}) = err
67+
{
68+
let loc = raw_location.start().to_usize();
69+
let mut iter = source.chars();
70+
if let Some(quote) = iter.nth(loc) {
71+
if iter.next() == Some(quote) && iter.next() == Some(quote) {
72+
return ShellExecResult::ContinueLine;
7473
}
7574
}
76-
_ => (),
7775
};
7876

7977
// bad_error == true if we are handling an error that should be thrown even if we are continuing

0 commit comments

Comments
 (0)