Skip to content

Commit 4b4e178

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

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy