mirror of
https://github.com/notohh/rustlings.git
synced 2024-12-17 22:58:08 -05:00
passes clippy lints
This commit is contained in:
parent
388f8da97f
commit
92a1214dcd
2 changed files with 8 additions and 9 deletions
12
src/list.rs
12
src/list.rs
|
@ -32,9 +32,9 @@ fn handle_list(app_state: &mut AppState, stdout: &mut StdoutLock) -> Result<()>
|
||||||
}
|
}
|
||||||
|
|
||||||
list_state.message.clear();
|
list_state.message.clear();
|
||||||
|
|
||||||
let curr_key = key.code;
|
let curr_key = key.code;
|
||||||
|
|
||||||
if is_searching {
|
if is_searching {
|
||||||
match curr_key {
|
match curr_key {
|
||||||
KeyCode::Esc | KeyCode::Enter => {
|
KeyCode::Esc | KeyCode::Enter => {
|
||||||
|
@ -46,10 +46,10 @@ fn handle_list(app_state: &mut AppState, stdout: &mut StdoutLock) -> Result<()>
|
||||||
list_state.search_query.push(k);
|
list_state.search_query.push(k);
|
||||||
list_state.message.push_str("search:");
|
list_state.message.push_str("search:");
|
||||||
list_state.message.push_str(&list_state.search_query);
|
list_state.message.push_str(&list_state.search_query);
|
||||||
list_state.message.push_str("|");
|
list_state.message.push('|');
|
||||||
|
|
||||||
list_state.select_if_matches_search_query();
|
list_state.select_if_matches_search_query();
|
||||||
|
|
||||||
list_state.draw(stdout)?;
|
list_state.draw(stdout)?;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ fn handle_list(app_state: &mut AppState, stdout: &mut StdoutLock) -> Result<()>
|
||||||
list_state.search_query.pop();
|
list_state.search_query.pop();
|
||||||
list_state.message.push_str("search:");
|
list_state.message.push_str("search:");
|
||||||
list_state.message.push_str(&list_state.search_query);
|
list_state.message.push_str(&list_state.search_query);
|
||||||
list_state.message.push_str("|");
|
list_state.message.push('|');
|
||||||
|
|
||||||
list_state.select_if_matches_search_query();
|
list_state.select_if_matches_search_query();
|
||||||
|
|
||||||
|
|
|
@ -346,7 +346,7 @@ impl<'a> ListState<'a> {
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn select_if_matches_search_query(&mut self) {
|
pub fn select_if_matches_search_query(&mut self) {
|
||||||
let idx = self
|
let idx = self
|
||||||
.app_state
|
.app_state
|
||||||
|
@ -360,7 +360,7 @@ impl<'a> ListState<'a> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
match idx {
|
match idx {
|
||||||
Some(i) => {
|
Some(i) => {
|
||||||
// ? do we need this function call?
|
// ? do we need this function call?
|
||||||
|
@ -375,7 +375,6 @@ impl<'a> ListState<'a> {
|
||||||
self.message.push_str(&msg);
|
self.message.push_str(&msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return `true` if there was something to select.
|
// Return `true` if there was something to select.
|
||||||
|
|
Loading…
Reference in a new issue