diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-09-28 11:47:39 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-09-28 11:52:48 +0800 |
| commit | f6e4972fd1b62d962d514ba9641ae19fcc5549d9 (patch) | |
| tree | c38e24cf1cf0222c26c2e4270b5a1314d8b868f9 /src | |
| parent | 03d456f0119e80f611952eec5c1b2da90b55e913 (diff) | |
perf: parser unused if
Diffstat (limited to 'src')
| -rw-r--r-- | src/parser.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/parser.rs b/src/parser.rs index 7e37376..9a139e4 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -73,14 +73,10 @@ pub fn process(strs: SplitWithMetadata<'_>) -> Vec<Expr<'_>> { // TODO: fix one line if else as not delimited by {} for s in str.split_whitespace() { - if let Some(token) = tokenizer::parse(if let len = s.len() { - if s.starts_with("println") { - "println" - } else if s.starts_with("throw") { - "throw" - } else { - s - } + if let Some(token) = tokenizer::parse(if s.starts_with("println") { + "println" + } else if s.starts_with("throw") { + "throw" } else { s }) { |
