fix(clippy): Use faster methods on Iterators
- Use `find` instead of `position(..).next()` - Use `any` instead of `position(..).next().is_some()/.is_none()` - Use `first/next` instead of `get(0)/nth(0)` - Prefer `for` loops over `while let` loops on iterators May improve performance.
This commit is contained in:
1 parent
1ccc6c9ce0
commit
191aacc7d7
7 files changed
+9
-13
No files matched your search
@@ -71,7 +71,7 @@ impl LocalProcessInfo {
|
||||
Some(LinuxStat {
|
||||
pid,
|
||||
name: name.to_string(),
|
||||
status: fields.get(0)?.to_string(),
|
||||
status: fields.first()?.to_string(),
|
||||
ppid: fields.get(1)?.parse().ok()?,
|
||||
starttime: fields.get(20)?.parse().ok()?,
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user