From 5f88c0f5ed2d4c5657db81b89db94a0812a92de8 Mon Sep 17 00:00:00 2001 From: Adrian Heine Date: Fri, 17 Dec 2021 18:04:23 +0100 Subject: [PATCH] Clippy --- src/build.rs | 5 ++--- src/command_runner.rs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/build.rs b/src/build.rs index 180cce0..02566e2 100644 --- a/src/build.rs +++ b/src/build.rs @@ -44,9 +44,8 @@ pub fn create_static_output_files(source_dir: &str) { } } Err(err) => { - if err.kind() == NotFound { - } else { - Err(err).unwrap() + if err.kind() != NotFound { + panic!("Unexpected error: {}", err) } } } diff --git a/src/command_runner.rs b/src/command_runner.rs index b672a4c..5f37ca1 100644 --- a/src/command_runner.rs +++ b/src/command_runner.rs @@ -181,7 +181,7 @@ where { async fn run(&self, program: &str, args: &[&OsStr], input: &str) -> IoResult { let raw_new_args = [self.user_name, "-s", "/usr/bin/env", "--", program]; - let mut new_args: Vec<&OsStr> = raw_new_args.iter().map(|s| s.as_ref()).collect(); + let mut new_args: Vec<&OsStr> = raw_new_args.iter().map(AsRef::as_ref).collect(); new_args.extend_from_slice(args); self.command_runner.run("su", &new_args, input).await }