Skip to content

Commit

Permalink
Make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Jan 6, 2025
1 parent d48e9af commit 69eee8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pam/rpassword.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fn read_unbuffered_with_feedback(

if read_byte == b'\n' || read_byte == b'\r' {
erase_feedback(sink, i);
sink.write(&[b'\n'])?;
let _ = sink.write(b"\n");
break;
}

Expand All @@ -152,10 +152,11 @@ fn read_unbuffered_with_feedback(
i -= 1;
}
} else {
#[allow(clippy::collapsible_else_if)]
if let Some(dest) = password.get_mut(i) {
*dest = read_byte;
i += 1;
let _ = sink.write(&[b'*']);
let _ = sink.write(b"*");
} else {
erase_feedback(sink, i);

Expand All @@ -167,6 +168,7 @@ fn read_unbuffered_with_feedback(
}
}


Ok(password)
}

Expand Down

0 comments on commit 69eee8f

Please sign in to comment.