Browse Source

Clippy

master
Adrian Heine 3 years ago
parent
commit
5f88c0f5ed
  1. 5
      src/build.rs
  2. 2
      src/command_runner.rs

5
src/build.rs

@ -44,9 +44,8 @@ pub fn create_static_output_files(source_dir: &str) {
} }
} }
Err(err) => { Err(err) => {
if err.kind() == NotFound {
} else {
Err(err).unwrap()
if err.kind() != NotFound {
panic!("Unexpected error: {}", err)
} }
} }
} }

2
src/command_runner.rs

@ -181,7 +181,7 @@ where
{ {
async fn run(&self, program: &str, args: &[&OsStr], input: &str) -> IoResult<Output> { async fn run(&self, program: &str, args: &[&OsStr], input: &str) -> IoResult<Output> {
let raw_new_args = [self.user_name, "-s", "/usr/bin/env", "--", program]; 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); new_args.extend_from_slice(args);
self.command_runner.run("su", &new_args, input).await self.command_runner.run("su", &new_args, input).await
} }

Loading…
Cancel
Save