simplify interact_back code
This commit is contained in:
parent
43a6a80bd1
commit
82263b8ea7
@ -43,13 +43,15 @@ impl<'a> AutoComplete<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn interact_back(&mut self, new_string: &mut String, movement: &Movement) {
|
fn interact_back(&mut self, new_string: &mut String, movement: &Movement) {
|
||||||
|
if movement == &Movement::None {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
match self.hint {
|
match self.hint {
|
||||||
HintEnum::Many(hints) => {
|
HintEnum::Many(hints) => {
|
||||||
if movement == &Movement::Complete {
|
if movement == &Movement::Complete {
|
||||||
*new_string += hints[self.i];
|
*new_string += hints[self.i];
|
||||||
return;
|
return;
|
||||||
} else if movement == &Movement::None {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let max_i = hints.len() as i16 - 1;
|
let max_i = hints.len() as i16 - 1;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user