refactor: fix clippy error

This commit is contained in:
ClementTsang 2020-05-21 21:46:21 -04:00
parent b33ea11af2
commit c7edad91ed

View File

@ -163,8 +163,7 @@ impl ProcessQuery for ProcWidgetState {
compare_prefix: None,
});
}
} else {
if queue_top == "(" {
} else if queue_top == "(" {
if query.is_empty() {
return Err(QueryError("Missing closing parentheses".into()));
}
@ -257,10 +256,7 @@ impl ProcessQuery for ProcWidgetState {
PrefixType::Name => {
return Ok(Prefix {
or: None,
regex_prefix: Some((
prefix_type,
StringQuery::Value(content),
)),
regex_prefix: Some((prefix_type, StringQuery::Value(content))),
compare_prefix: None,
})
}
@ -345,8 +341,7 @@ impl ProcessQuery for ProcWidgetState {
| PrefixType::TRead
| PrefixType::TWrite => {
if let Some(potential_unit) = query.front() {
match potential_unit.to_lowercase().as_str()
{
match potential_unit.to_lowercase().as_str() {
"tb" => {
value *= 1_000_000_000_000.0;
query.pop_front();
@ -406,7 +401,6 @@ impl ProcessQuery for ProcWidgetState {
return Err(QueryError("Missing argument for search prefix".into()));
}
}
}
} else if inside_quotation {
// Uh oh, it's empty with quotes!
return Err(QueryError("Missing closing quotation".into()));