Merge #7326
7326: Use `is_ident` when converting Path to an Identifier r=edwin0cheng a=kevaundray Co-authored-by: Kevaundray Wedderburn <kevtheappdev@gmail.com>
This commit is contained in:
commit
fcc109e890
@ -87,7 +87,7 @@ impl ModPath {
|
||||
|
||||
/// If this path is a single identifier, like `foo`, return its name.
|
||||
pub fn as_ident(&self) -> Option<&Name> {
|
||||
if self.kind != PathKind::Plain || self.segments.len() > 1 {
|
||||
if !self.is_ident() {
|
||||
return None;
|
||||
}
|
||||
self.segments.first()
|
||||
|
Loading…
x
Reference in New Issue
Block a user