Skip to content

Commit

Permalink
Clippy IV: Last Blood
Browse files Browse the repository at this point in the history
  • Loading branch information
svartalf committed Mar 3, 2020
1 parent b980a48 commit 7df8a94
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions examples/wait.rs
Expand Up @@ -16,22 +16,19 @@ use heim::process;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
#[cfg(target_os = "linux")] // Not implemented yet for other platforms
{
let pid = env::args()
.nth(1)
.ok_or_else(|| {
eprintln!("Process PID is not passed as a CLI argument");
io::Error::from(io::ErrorKind::InvalidInput)
})?
.parse::<process::Pid>()?;
let pid = env::args()
.nth(1)
.ok_or_else(|| {
eprintln!("Process PID is not passed as a CLI argument");
io::Error::from(io::ErrorKind::InvalidInput)
})?
.parse::<process::Pid>()?;

let process = process::get(pid).await?;
let process = process::get(pid).await?;

println!("Watching for process {} completion", pid);
process.wait().await?;
println!("Process {} had exited", pid);
}
println!("Watching for process {} completion", pid);
process.wait().await?;
println!("Process {} had exited", pid);

Ok(())
}

0 comments on commit 7df8a94

Please sign in to comment.