Skip to content

Clippy fixes for 1.87 #1139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/apparmor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod sys;
/// Set the profile for the next exec call if AppArmor is enabled
pub fn set_profile_for_next_exec(profile_name: &str) -> std::io::Result<()> {
if apparmor_is_enabled()? {
apparmor_prepare_exec(&profile_name)
apparmor_prepare_exec(profile_name)
} else {
// if the sysadmin doesn't have apparmor enabled, fail softly
Ok(())
Expand Down
2 changes: 2 additions & 0 deletions src/pam/rpassword.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
let mut pwd_iter = password.iter_mut();

const EOL: u8 = 0x0A;
#[allow(clippy::unbuffered_bytes)]

Check failure on line 89 in src/pam/rpassword.rs

View workflow job for this annotation

GitHub Actions / clippy

unknown lint: `clippy::unbuffered_bytes`
let input = source.bytes().take_while(|x| x.as_ref().ok() != Some(&EOL));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using BufReader as suggested by clippy would change behavior.


for read_byte in input {
Expand Down Expand Up @@ -122,6 +123,7 @@

// invariant: the amount of nonzero-bytes in the buffer correspond
// with the amount of asterisks on the terminal (both tracked in `pw_len`)
#[allow(clippy::unbuffered_bytes)]

Check failure on line 126 in src/pam/rpassword.rs

View workflow job for this annotation

GitHub Actions / clippy

unknown lint: `clippy::unbuffered_bytes`
for read_byte in source.bytes() {
let read_byte = read_byte?;

Expand Down
Loading