Merge #5105
5105: Simlify with matches!() r=matklad a=Veetaha Co-authored-by: Veetaha <veetaha2@gmail.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user