5105: Simlify with matches!() r=matklad a=Veetaha



Co-authored-by: Veetaha <veetaha2@gmail.com>
This commit is contained in:
bors[bot]
2020-06-28 22:37:25 +00:00
committed by GitHub
20 changed files with 44 additions and 119 deletions

View File

@@ -28,16 +28,10 @@ pub enum Verbosity {
impl Verbosity {
pub fn is_verbose(self) -> bool {
match self {
Verbosity::Verbose | Verbosity::Spammy => true,
_ => false,
}
matches!(self, Verbosity::Verbose | Verbosity::Spammy)
}
pub fn is_spammy(self) -> bool {
match self {
Verbosity::Spammy => true,
_ => false,
}
matches!(self, Verbosity::Spammy)
}
}

View File

@@ -78,10 +78,7 @@ pub fn analysis_bench(
}
}
BenchWhat::Complete(pos) | BenchWhat::GotoDef(pos) => {
let is_completion = match what {
BenchWhat::Complete(..) => true,
_ => false,
};
let is_completion = matches!(what, BenchWhat::Complete(..));
let offset = host
.analysis()