mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-24 22:24:53 +02:00
refactor: fix clippy error
This commit is contained in:
parent
b33ea11af2
commit
c7edad91ed
@ -163,8 +163,7 @@ impl ProcessQuery for ProcWidgetState {
|
|||||||
compare_prefix: None,
|
compare_prefix: None,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else if queue_top == "(" {
|
||||||
if queue_top == "(" {
|
|
||||||
if query.is_empty() {
|
if query.is_empty() {
|
||||||
return Err(QueryError("Missing closing parentheses".into()));
|
return Err(QueryError("Missing closing parentheses".into()));
|
||||||
}
|
}
|
||||||
@ -257,10 +256,7 @@ impl ProcessQuery for ProcWidgetState {
|
|||||||
PrefixType::Name => {
|
PrefixType::Name => {
|
||||||
return Ok(Prefix {
|
return Ok(Prefix {
|
||||||
or: None,
|
or: None,
|
||||||
regex_prefix: Some((
|
regex_prefix: Some((prefix_type, StringQuery::Value(content))),
|
||||||
prefix_type,
|
|
||||||
StringQuery::Value(content),
|
|
||||||
)),
|
|
||||||
compare_prefix: None,
|
compare_prefix: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -345,8 +341,7 @@ impl ProcessQuery for ProcWidgetState {
|
|||||||
| PrefixType::TRead
|
| PrefixType::TRead
|
||||||
| PrefixType::TWrite => {
|
| PrefixType::TWrite => {
|
||||||
if let Some(potential_unit) = query.front() {
|
if let Some(potential_unit) = query.front() {
|
||||||
match potential_unit.to_lowercase().as_str()
|
match potential_unit.to_lowercase().as_str() {
|
||||||
{
|
|
||||||
"tb" => {
|
"tb" => {
|
||||||
value *= 1_000_000_000_000.0;
|
value *= 1_000_000_000_000.0;
|
||||||
query.pop_front();
|
query.pop_front();
|
||||||
@ -406,7 +401,6 @@ impl ProcessQuery for ProcWidgetState {
|
|||||||
return Err(QueryError("Missing argument for search prefix".into()));
|
return Err(QueryError("Missing argument for search prefix".into()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if inside_quotation {
|
} else if inside_quotation {
|
||||||
// Uh oh, it's empty with quotes!
|
// Uh oh, it's empty with quotes!
|
||||||
return Err(QueryError("Missing closing quotation".into()));
|
return Err(QueryError("Missing closing quotation".into()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user