diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-11-23 18:22:51 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-11-23 20:26:31 +0000 |
| commit | da40965300eec9aad4ea2f2fde9e6b59262cd5d6 (patch) | |
| tree | 57171d455fea2007b2cf5e7fc710ae71d47e7028 /compiler/rustc_save_analysis/src | |
| parent | 9b9c7d0ecc9d902b3ed5eac2f06f8669fed57f43 (diff) | |
| download | rust-da40965300eec9aad4ea2f2fde9e6b59262cd5d6.tar.gz rust-da40965300eec9aad4ea2f2fde9e6b59262cd5d6.zip | |
Add `Mutability::{is_mut,is_not}`
Diffstat (limited to 'compiler/rustc_save_analysis/src')
| -rw-r--r-- | compiler/rustc_save_analysis/src/sig.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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(); |
