diff options
Diffstat (limited to 'crates/atuin-history/src/stats.rs')
| -rw-r--r-- | crates/atuin-history/src/stats.rs | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/crates/atuin-history/src/stats.rs b/crates/atuin-history/src/stats.rs index 8bf03e42..fedb1487 100644 --- a/crates/atuin-history/src/stats.rs +++ b/crates/atuin-history/src/stats.rs @@ -79,25 +79,19 @@ fn split_at_pipe(command: &str) -> Vec<&str> { while let Some((i, c)) = graphemes.next() { let current = i; match c { - "\"" => { - if command[start..current] != *"\"" { - quoted = !quoted; - } + "\"" if command[start..current] != *"\"" => { + quoted = !quoted; } - "'" => { - if command[start..current] != *"'" { - quoted = !quoted; - } + "'" if command[start..current] != *"'" => { + quoted = !quoted; } - "\\" => if graphemes.next().is_some() {}, - "|" => { - if !quoted { - if current > start && command[start..].starts_with('|') { - start += 1; - } - result.push(&command[start..current]); - start = current; + "\\" if graphemes.next().is_some() => {} + "|" if !quoted => { + if current > start && command[start..].starts_with('|') { + start += 1; } + result.push(&command[start..current]); + start = current; } _ => {} } |
