mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-26 15:26:29 +00:00
moved continue to end of if-block
This commit is contained in:
parent
3125561474
commit
948e16e3c7
1 changed files with 3 additions and 7 deletions
12
src/list.rs
12
src/list.rs
|
@ -1,4 +1,4 @@
|
||||||
use anyhow::{Context, Ok, Result};
|
use anyhow::{Context, Result};
|
||||||
use crossterm::{
|
use crossterm::{
|
||||||
cursor,
|
cursor,
|
||||||
event::{
|
event::{
|
||||||
|
@ -40,7 +40,6 @@ fn handle_list(app_state: &mut AppState, stdout: &mut StdoutLock) -> Result<()>
|
||||||
KeyCode::Esc | KeyCode::Enter => {
|
KeyCode::Esc | KeyCode::Enter => {
|
||||||
is_searching = false;
|
is_searching = false;
|
||||||
list_state.search_query.clear();
|
list_state.search_query.clear();
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
KeyCode::Char(k) => {
|
KeyCode::Char(k) => {
|
||||||
list_state.search_query.push(k);
|
list_state.search_query.push(k);
|
||||||
|
@ -51,7 +50,6 @@ fn handle_list(app_state: &mut AppState, stdout: &mut StdoutLock) -> Result<()>
|
||||||
list_state.select_if_matches_search_query();
|
list_state.select_if_matches_search_query();
|
||||||
|
|
||||||
list_state.draw(stdout)?;
|
list_state.draw(stdout)?;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
KeyCode::Backspace => {
|
KeyCode::Backspace => {
|
||||||
list_state.search_query.pop();
|
list_state.search_query.pop();
|
||||||
|
@ -62,13 +60,11 @@ fn handle_list(app_state: &mut AppState, stdout: &mut StdoutLock) -> Result<()>
|
||||||
list_state.select_if_matches_search_query();
|
list_state.select_if_matches_search_query();
|
||||||
|
|
||||||
list_state.draw(stdout)?;
|
list_state.draw(stdout)?;
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
_ => {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
match key.code {
|
match key.code {
|
||||||
KeyCode::Char('q') => {
|
KeyCode::Char('q') => {
|
||||||
|
|
Loading…
Reference in a new issue