Skip to content
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

updates to pass 1.75 version of clippy #813

Merged
merged 1 commit into from
Jan 8, 2024
Merged
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/common/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl CommandAndArguments {
arguments = vec!["-c".to_string(), escaped(arguments)]
}
} else {
command = arguments.get(0).map(|s| s.into()).unwrap_or_default();
command = arguments.first().map(|s| s.into()).unwrap_or_default();
arguments.remove(0);

// remember the original binary name before resolving symlinks; this is not
Expand Down
6 changes: 3 additions & 3 deletions src/common/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
Configuration(String),
Options(String),
Pam(PamError),
IoError(Option<PathBuf>, std::io::Error),
Io(Option<PathBuf>, std::io::Error),
MaxAuthAttempts(usize),
PathValidation(PathBuf),
StringValidation(String),
Expand Down Expand Up @@ -64,7 +64,7 @@
Error::Configuration(e) => write!(f, "invalid configuration: {e}"),
Error::Options(e) => write!(f, "{e}"),
Error::Pam(e) => write!(f, "PAM error: {e}"),
Error::IoError(location, e) => {
Error::Io(location, e) => {

Check warning on line 67 in src/common/error.rs

View check run for this annotation

Codecov / codecov/patch

src/common/error.rs#L67

Added line #L67 was not covered by tests
if let Some(path) = location {
write!(f, "cannot execute '{}': {e}", path.display())
} else {
Expand Down Expand Up @@ -98,7 +98,7 @@

impl From<std::io::Error> for Error {
fn from(err: std::io::Error) -> Self {
Error::IoError(None, err)
Error::Io(None, err)

Check warning on line 101 in src/common/error.rs

View check run for this annotation

Codecov / codecov/patch

src/common/error.rs#L101

Added line #L101 was not covered by tests
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/sudo/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
log_command_execution(&context);

crate::exec::run_command(&context, target_env)
.map_err(|io_error| Error::IoError(Some(context.command.command), io_error))
.map_err(|io_error| Error::Io(Some(context.command.command), io_error))

Check warning on line 89 in src/sudo/pipeline.rs

View check run for this annotation

Codecov / codecov/patch

src/sudo/pipeline.rs#L89

Added line #L89 was not covered by tests
} else {
Err(Error::CommandNotFound(context.command.command))
};
Expand Down
Loading