Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errors
Use the power of adding helper function to simplify code w/ `Mutability` r? `@compiler-errors`
This commit is contained in:
commit
a2e485c25c
28 changed files with 144 additions and 218 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue