1
Fork 0

Use Mutability::{is_mut, is_not}

This commit is contained in:
Maybe Waffle 2023-01-30 12:00:11 +00:00
parent fd649a3cc5
commit 4d75f61832
11 changed files with 13 additions and 21 deletions

View file

@ -29,7 +29,6 @@ use crate::{id_from_def_id, SaveContext};
use rls_data::{SigElement, Signature};
use rustc_ast::Mutability;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
use rustc_hir_pretty::id_to_string;
@ -769,7 +768,7 @@ impl<'hir> Sig for hir::ForeignItem<'hir> {
}
hir::ForeignItemKind::Static(ref ty, m) => {
let mut text = "static ".to_owned();
if m == Mutability::Mut {
if m.is_mut() {
text.push_str("mut ");
}
let name = self.ident.to_string();