1
Fork 0

Add Mutability::{is_mut,is_not}

This commit is contained in:
Maybe Waffle 2022-11-23 18:22:51 +00:00
parent 9b9c7d0ecc
commit da40965300
14 changed files with 29 additions and 26 deletions

View file

@ -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();