Skip to content

Commit e5cf58e

Browse files
authored
Merge pull request #813 from memorysafety/clippy-update
updates to pass 1.75 version of clippy
2 parents 7f82d3a + d8d8927 commit e5cf58e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/common/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl CommandAndArguments {
6363
arguments = vec!["-c".to_string(), escaped(arguments)]
6464
}
6565
} else {
66-
command = arguments.get(0).map(|s| s.into()).unwrap_or_default();
66+
command = arguments.first().map(|s| s.into()).unwrap_or_default();
6767
arguments.remove(0);
6868

6969
// remember the original binary name before resolving symlinks; this is not

src/common/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub enum Error {
2525
Configuration(String),
2626
Options(String),
2727
Pam(PamError),
28-
IoError(Option<PathBuf>, std::io::Error),
28+
Io(Option<PathBuf>, std::io::Error),
2929
MaxAuthAttempts(usize),
3030
PathValidation(PathBuf),
3131
StringValidation(String),
@@ -64,7 +64,7 @@ impl fmt::Display for Error {
6464
Error::Configuration(e) => write!(f, "invalid configuration: {e}"),
6565
Error::Options(e) => write!(f, "{e}"),
6666
Error::Pam(e) => write!(f, "PAM error: {e}"),
67-
Error::IoError(location, e) => {
67+
Error::Io(location, e) => {
6868
if let Some(path) = location {
6969
write!(f, "cannot execute '{}': {e}", path.display())
7070
} else {
@@ -98,7 +98,7 @@ impl From<PamError> for Error {
9898

9999
impl From<std::io::Error> for Error {
100100
fn from(err: std::io::Error) -> Self {
101-
Error::IoError(None, err)
101+
Error::Io(None, err)
102102
}
103103
}
104104

src/sudo/pipeline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl<Policy: PolicyPlugin, Auth: AuthPlugin> Pipeline<Policy, Auth> {
8686
log_command_execution(&context);
8787

8888
crate::exec::run_command(&context, target_env)
89-
.map_err(|io_error| Error::IoError(Some(context.command.command), io_error))
89+
.map_err(|io_error| Error::Io(Some(context.command.command), io_error))
9090
} else {
9191
Err(Error::CommandNotFound(context.command.command))
9292
};

0 commit comments

Comments
 (0)