From da40965300eec9aad4ea2f2fde9e6b59262cd5d6 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Wed, 23 Nov 2022 18:22:51 +0000 Subject: Add `Mutability::{is_mut,is_not}` --- compiler/rustc_save_analysis/src/sig.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_save_analysis/src') diff --git a/compiler/rustc_save_analysis/src/sig.rs b/compiler/rustc_save_analysis/src/sig.rs index 9fcba3e46f1..74048ff7da3 100644 --- a/compiler/rustc_save_analysis/src/sig.rs +++ b/compiler/rustc_save_analysis/src/sig.rs @@ -169,7 +169,7 @@ impl<'hir> Sig for hir::Ty<'hir> { let mut prefix = "&".to_owned(); prefix.push_str(&lifetime.name.ident().to_string()); prefix.push(' '); - if let hir::Mutability::Mut = mt.mutbl { + if mt.mutbl.is_mut() { prefix.push_str("mut "); }; @@ -332,7 +332,7 @@ impl<'hir> Sig for hir::Item<'hir> { match self.kind { hir::ItemKind::Static(ref ty, m, ref body) => { let mut text = "static ".to_owned(); - if m == hir::Mutability::Mut { + if m.is_mut() { text.push_str("mut "); } let name = self.ident.to_string(); -- cgit 1.4.1-3-g733a5