Skip to content

Commit e08b569

Browse files
committed
Collapse nested if into match guard in read_secure
Silences clippy::collapsible_match warning on clippy 1.95+.
1 parent 3e3e277 commit e08b569

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/windows_term/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,9 @@ pub(crate) fn read_secure() -> io::Result<String> {
405405
Key::Enter => {
406406
break;
407407
}
408-
Key::Char('\x08') => {
409-
if !rv.is_empty() {
410-
let new_len = rv.len() - 1;
411-
rv.truncate(new_len);
412-
}
408+
Key::Char('\x08') if !rv.is_empty() => {
409+
let new_len = rv.len() - 1;
410+
rv.truncate(new_len);
413411
}
414412
Key::Char(c) => {
415413
rv.push(c);

0 commit comments

Comments
 (0)