]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/clean/mod.rs
Simplify PatIdent to contain an Ident rather than a Path
[rust.git] / src / librustdoc / clean / mod.rs
index 87151708812e54a5f106291d5a04fd851bf6a0dc..58985f832ce32091e01106dfe80e0c73aabcc22c 100644 (file)
@@ -1583,8 +1583,6 @@ fn clean(&self) -> PathSegment {
 }
 
 fn path_to_str(p: &ast::Path) -> String {
-    use syntax::parse::token;
-
     let mut s = String::new();
     let mut first = true;
     for i in p.segments.iter().map(|x| token::get_ident(x.identifier)) {
@@ -1953,7 +1951,7 @@ fn name_from_pat(p: &ast::Pat) -> String {
     match p.node {
         PatWild => "_".to_string(),
         PatWildMulti => "..".to_string(),
-        PatIdent(_, ref p, _) => path_to_str(p),
+        PatIdent(_, ref p, _) => token::get_ident(p.node).get().to_string(),
         PatEnum(ref p, _) => path_to_str(p),
         PatStruct(..) => fail!("tried to get argument name from pat_struct, \
                                 which is not allowed in function arguments"),