More uses of the matches! macro
This commit is contained in:
parent
2987785df3
commit
7a41532ef9
2 changed files with 9 additions and 16 deletions
|
@ -1806,12 +1806,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||
output,
|
||||
c_variadic,
|
||||
implicit_self: decl.inputs.get(0).map_or(hir::ImplicitSelfKind::None, |arg| {
|
||||
let is_mutable_pat = match arg.pat.kind {
|
||||
PatKind::Ident(BindingMode::ByValue(mt) | BindingMode::ByRef(mt), _, _) => {
|
||||
mt == Mutability::Mut
|
||||
}
|
||||
_ => false,
|
||||
};
|
||||
use BindingMode::{ByRef, ByValue};
|
||||
let is_mutable_pat = matches!(
|
||||
arg.pat.kind,
|
||||
PatKind::Ident(ByValue(Mutability::Mut) | ByRef(Mutability::Mut), ..)
|
||||
);
|
||||
|
||||
match arg.ty.kind {
|
||||
TyKind::ImplicitSelf if is_mutable_pat => hir::ImplicitSelfKind::Mut,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue