about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2013-01-22 11:57:39 -0800
committerTim Chevalier <chevalier@alum.wellesley.edu>2013-01-22 11:58:08 -0800
commita8d076d2de662cb1a13cc1efa092e7202b129eae (patch)
tree03992d0115aa2063fdfbd5e991dc9baee0ec04a1 /src/libsyntax
parent8869e723869fe95af0cd022d84c134f7a84fd4a0 (diff)
downloadrust-a8d076d2de662cb1a13cc1efa092e7202b129eae.tar.gz
rust-a8d076d2de662cb1a13cc1efa092e7202b129eae.zip
syntax/rustc: Make some metadata-related functions take slices, kill bad copies
Too small to review.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast_map.rs8
-rw-r--r--src/libsyntax/attr.rs2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs
index 71f2a0002ac..804de5656ee 100644
--- a/src/libsyntax/ast_map.rs
+++ b/src/libsyntax/ast_map.rs
@@ -56,9 +56,9 @@ impl path_elt : cmp::Eq {
 
 type path = ~[path_elt];
 
-/* FIXMEs that say "bad" are as per #2543 */
-fn path_to_str_with_sep(p: path, sep: ~str, itr: @ident_interner) -> ~str {
-    let strs = do vec::map(p) |e| {
+fn path_to_str_with_sep(p: &[path_elt], sep: ~str, itr: @ident_interner)
+    -> ~str {
+    let strs = do p.map |e| {
         match *e {
           path_mod(s) => *itr.get(s),
           path_name(s) => *itr.get(s)
@@ -76,7 +76,7 @@ fn path_ident_to_str(p: path, i: ident, itr: @ident_interner) -> ~str {
     }
 }
 
-fn path_to_str(p: path, itr: @ident_interner) -> ~str {
+fn path_to_str(p: &[path_elt], itr: @ident_interner) -> ~str {
     path_to_str_with_sep(p, ~"::", itr)
 }
 
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs
index 3906711b4b6..531b9501d6c 100644
--- a/src/libsyntax/attr.rs
+++ b/src/libsyntax/attr.rs
@@ -369,7 +369,7 @@ impl inline_attr : cmp::Eq {
 }
 
 /// True if something like #[inline] is found in the list of attrs.
-fn find_inline_attr(attrs: ~[ast::attribute]) -> inline_attr {
+fn find_inline_attr(attrs: &[ast::attribute]) -> inline_attr {
     // FIXME (#2809)---validate the usage of #[inline] and #[inline(always)]
     do vec::foldl(ia_none, attrs) |ia,attr| {
         match attr.node.value.node {