mirror of
https://github.com/rust-lang/rustlings
synced 2024-11-10 06:34:20 +00:00
Simplify handling p
in list
This commit is contained in:
parent
da8b3d143a
commit
03baa471d9
1 changed files with 6 additions and 6 deletions
12
src/list.rs
12
src/list.rs
|
@ -72,15 +72,15 @@ fn handle_list(app_state: &mut AppState, stdout: &mut StdoutLock) -> Result<()>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
KeyCode::Char('p') => {
|
KeyCode::Char('p') => {
|
||||||
let message = if list_state.filter() == Filter::Pending {
|
if list_state.filter() == Filter::Pending {
|
||||||
list_state.set_filter(Filter::None);
|
list_state.set_filter(Filter::None);
|
||||||
"Disabled filter PENDING"
|
list_state.message.push_str("Disabled filter PENDING");
|
||||||
} else {
|
} else {
|
||||||
list_state.set_filter(Filter::Pending);
|
list_state.set_filter(Filter::Pending);
|
||||||
"Enabled filter PENDING │ Press p again to disable the filter"
|
list_state.message.push_str(
|
||||||
};
|
"Enabled filter PENDING │ Press p again to disable the filter",
|
||||||
|
);
|
||||||
list_state.message.push_str(message);
|
}
|
||||||
}
|
}
|
||||||
KeyCode::Char('r') => list_state.reset_selected()?,
|
KeyCode::Char('r') => list_state.reset_selected()?,
|
||||||
KeyCode::Char('c') => {
|
KeyCode::Char('c') => {
|
||||||
|
|
Loading…
Reference in a new issue