mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
needless_borrow
This commit is contained in:
parent
d351cb8dfb
commit
3839f9a9a2
9 changed files with 14 additions and 15 deletions
|
@ -294,14 +294,14 @@ impl SearchMode {
|
|||
pub fn check(self, query: &str, case_sensitive: bool, candidate: &str) -> bool {
|
||||
match self {
|
||||
SearchMode::Exact if case_sensitive => candidate == query,
|
||||
SearchMode::Exact => candidate.eq_ignore_ascii_case(&query),
|
||||
SearchMode::Exact => candidate.eq_ignore_ascii_case(query),
|
||||
SearchMode::Prefix => {
|
||||
query.len() <= candidate.len() && {
|
||||
let prefix = &candidate[..query.len() as usize];
|
||||
if case_sensitive {
|
||||
prefix == query
|
||||
} else {
|
||||
prefix.eq_ignore_ascii_case(&query)
|
||||
prefix.eq_ignore_ascii_case(query)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue