From cb3276fb3b5fb810b94e0044c852932642874e9e Mon Sep 17 00:00:00 2001 From: Herlon Aguiar Date: Sat, 16 Apr 2022 03:34:38 +0200 Subject: [PATCH] nu-cli/completions: removed unnecessary bool (#5207) --- crates/nu-cli/src/completions/completer.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/crates/nu-cli/src/completions/completer.rs b/crates/nu-cli/src/completions/completer.rs index 94275fb774..7bf9b408c8 100644 --- a/crates/nu-cli/src/completions/completer.rs +++ b/crates/nu-cli/src/completions/completer.rs @@ -71,7 +71,6 @@ impl NuCompleter { for (flat_idx, flat) in flattened.iter().enumerate() { if pos >= flat.0.start && pos < flat.0.end { // Context variables - let mut is_variable_completion = false; let most_left_var = most_left_variable(flat_idx, &working_set, flattened.clone()); @@ -85,13 +84,8 @@ impl NuCompleter { let mut prefix = working_set.get_span_contents(flat.0).to_vec(); prefix.remove(pos - flat.0.start); - // Check if has most left variable - if most_left_var.is_some() { - is_variable_completion = true; - } - // Variables completion - if prefix.starts_with(b"$") || is_variable_completion { + if prefix.starts_with(b"$") || most_left_var.is_some() { let mut completer = VariableCompletion::new( self.engine_state.clone(), self.stack.clone(),