clippy: collapse nested ifs into match guards (rust 1.98)
This commit is contained in:
+6
-10
@@ -379,11 +379,9 @@ fn text_inner(
|
||||
input.push(c);
|
||||
render(Render::Line(&input))?;
|
||||
}
|
||||
event::KeyCode::Backspace => {
|
||||
if !input.is_empty() {
|
||||
input.pop();
|
||||
render(Render::Line(&input))?;
|
||||
}
|
||||
event::KeyCode::Backspace if !input.is_empty() => {
|
||||
input.pop();
|
||||
render(Render::Line(&input))?;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
@@ -433,11 +431,9 @@ fn confirm_inner(
|
||||
input.push(c);
|
||||
render(Render::Line(&input))?;
|
||||
}
|
||||
event::KeyCode::Backspace => {
|
||||
if !input.is_empty() {
|
||||
input.pop();
|
||||
render(Render::Line(&input))?;
|
||||
}
|
||||
event::KeyCode::Backspace if !input.is_empty() => {
|
||||
input.pop();
|
||||
render(Render::Line(&input))?;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user