internal: Simplify

This commit is contained in:
Lukas Wirth 2022-06-23 20:08:29 +02:00
parent 312ac83caf
commit 2642f64570
6 changed files with 75 additions and 94 deletions

View file

@ -11,7 +11,7 @@ use crate::{
intern::Interned,
type_ref::{ConstScalarOrPath, LifetimeRef},
};
use hir_expand::name::{name, Name};
use hir_expand::name::Name;
use syntax::ast;
use crate::type_ref::{TypeBound, TypeRef};
@ -134,9 +134,7 @@ impl Path {
}
pub fn is_self_type(&self) -> bool {
self.type_anchor.is_none()
&& *self.generic_args == [None]
&& self.mod_path.as_ident() == Some(&name!(Self))
self.type_anchor.is_none() && *self.generic_args == [None] && self.mod_path.is_Self()
}
}