Skip to content

Commit

Permalink
cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
dkijania committed Jul 10, 2020
1 parent 8f5e6b0 commit 4c056a3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/measurement/benchmark/consumption_benchmark.rs
Expand Up @@ -88,9 +88,7 @@ impl ConsumptionBenchmarkRun {
.get_processes()
.iter()
.find(|(pid, _)| (named_process.id() as u32) == pid.as_u32())
.ok_or_else(|| ConsumptionBenchmarkError::NoProcessWitId(
named_process.clone(),
))?;
.ok_or_else(|| ConsumptionBenchmarkError::NoProcessWitId(named_process.clone()))?;

let marker = ResourcesUsage::new(
process.cpu_usage() as u32,
Expand Down
3 changes: 2 additions & 1 deletion src/openssl/mod.rs
Expand Up @@ -29,7 +29,8 @@ impl Openssl {
.wait();
println!("{}", cmd);

let lines: Vec<String> = captured.map(|r| r.unwrap_or_else(|_| "".to_owned()))
let lines: Vec<String> = captured
.map(|r| r.unwrap_or_else(|_| "".to_owned()))
.collect();
Ok(lines.join("\n"))
}
Expand Down
14 changes: 10 additions & 4 deletions src/process/mod.rs
Expand Up @@ -83,10 +83,16 @@ pub fn run_process_until_exited_successfully(
let mut attempts = max_attempts;

loop {
if command
.status()
.unwrap_or_else(|_| panic!("failed to get exit status of command: {}", &command_description))
.success()
let status = command
.status()
.unwrap_or_else(|_| {
panic!(
"failed to get exit status of command: {}",
&command_description
)
});

if status.success()
{
break;
}
Expand Down

0 comments on commit 4c056a3

Please sign in to comment.