mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-26 23:24:20 +02:00
refactor: fix clippy errors
This commit is contained in:
parent
6e81fbeebf
commit
ecc111b21a
@ -185,7 +185,7 @@ impl Prefix {
|
|||||||
pub fn check(&self, process: &ConvertedProcessData) -> bool {
|
pub fn check(&self, process: &ConvertedProcessData) -> bool {
|
||||||
fn matches_condition(condition: &QueryComparison, lhs: f64, rhs: f64) -> bool {
|
fn matches_condition(condition: &QueryComparison, lhs: f64, rhs: f64) -> bool {
|
||||||
match condition {
|
match condition {
|
||||||
QueryComparison::Equal => lhs == rhs,
|
QueryComparison::Equal => (lhs - rhs).abs() < f64::EPSILON,
|
||||||
QueryComparison::Less => lhs < rhs,
|
QueryComparison::Less => lhs < rhs,
|
||||||
QueryComparison::Greater => lhs > rhs,
|
QueryComparison::Greater => lhs > rhs,
|
||||||
QueryComparison::LessOrEqual => lhs <= rhs,
|
QueryComparison::LessOrEqual => lhs <= rhs,
|
||||||
|
11
src/main.rs
11
src/main.rs
@ -612,20 +612,15 @@ fn update_final_process_list(app: &mut App, widget_id: u64) {
|
|||||||
app.canvas_data
|
app.canvas_data
|
||||||
.process_data
|
.process_data
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|process| {
|
.filter(|process| {
|
||||||
let mut result = true;
|
|
||||||
if !is_invalid_or_blank {
|
if !is_invalid_or_blank {
|
||||||
result = if let Some(process_filter) = process_filter {
|
if let Some(process_filter) = process_filter {
|
||||||
process_filter.check(&process)
|
process_filter.check(&process)
|
||||||
} else {
|
} else {
|
||||||
true
|
true
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if result {
|
|
||||||
return Some(process);
|
|
||||||
} else {
|
} else {
|
||||||
None
|
true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.cloned()
|
.cloned()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user