Turn some functions from token.rs into methods on Ident
This commit is contained in:
@@ -107,8 +107,7 @@ impl Path {
|
||||
// or starts with something like `self`/`super`/`$crate`/etc.
|
||||
pub fn make_root(&self) -> Option<PathSegment> {
|
||||
if let Some(ident) = self.segments.get(0).map(|seg| seg.ident) {
|
||||
if ::parse::token::is_path_segment_keyword(ident) &&
|
||||
ident.name != keywords::Crate.name() {
|
||||
if ident.is_path_segment_keyword() && ident.name != keywords::Crate.name() {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user