]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/ast.rs
Fill in some missing parts in the default AST visitor
[rust.git] / src / libsyntax / ast.rs
index 75a976296489565aaa6e54e8f0c45c43deae4418..71261fa457fcd30e6342c7f330d4e3ca56890f8e 100644 (file)
@@ -1613,6 +1613,13 @@ pub fn id(&self) -> NodeId {
         }
     }
 
+    pub fn name(&self) -> Option<Ident> {
+        match *self {
+            PathListIdent { name, .. } => Some(name),
+            PathListMod { .. } => None,
+        }
+    }
+
     pub fn rename(&self) -> Option<Ident> {
         match *self {
             PathListIdent { rename, .. } | PathListMod { rename, .. } => rename