mirror of
https://github.com/nushell/nushell.git
synced 2024-11-29 03:44:19 +01:00
Fix unwrap
This commit is contained in:
parent
60bfa277d0
commit
c3abb3b687
@ -53,8 +53,7 @@ fn ps(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStream, She
|
||||
pin_utils::pin_mut!(processes);
|
||||
|
||||
while let Some(res) = processes.next().await {
|
||||
let (process, usage) = res.unwrap();
|
||||
|
||||
if let Ok((process, usage)) = res {
|
||||
let mut dict = TaggedDictBuilder::new(Tag::unknown_origin(span));
|
||||
dict.insert("pid", Value::int(process.pid()));
|
||||
if let Ok(name) = process.name().await {
|
||||
@ -66,6 +65,7 @@ fn ps(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStream, She
|
||||
dict.insert("cpu", Value::float(usage.get::<ratio::percent>() as f64));
|
||||
yield ReturnSuccess::value(dict.into_tagged_value());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Ok(stream.to_output_stream())
|
||||
|
Loading…
Reference in New Issue
Block a user