summary refs log tree commit diff
path: root/src/libsyntax/attr.rs
diff options
context:
space:
mode:
authorSimon BD <simon@server>2012-10-03 21:47:09 -0500
committerSimon BD <simon@server>2012-10-03 21:47:09 -0500
commitefcd2385ea2389f270ff8ac8bc256636f647b130 (patch)
tree7e142ef709bc907a34ab1cb252eef6dcc0e83b91 /src/libsyntax/attr.rs
parent44f8a4401ab37a45ba49db56611d77807bcbce35 (diff)
parent3ccf6f5932d8223fd6c5cbf7c6ac429ca9e8912a (diff)
downloadrust-efcd2385ea2389f270ff8ac8bc256636f647b130.tar.gz
rust-efcd2385ea2389f270ff8ac8bc256636f647b130.zip
Merge remote-tracking branch 'original/incoming' into incoming
Conflicts:
	src/libstd/json.rs
	src/libstd/sort.rs
Diffstat (limited to 'src/libsyntax/attr.rs')
-rw-r--r--src/libsyntax/attr.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs
index a291501ef5f..374300f07c7 100644
--- a/src/libsyntax/attr.rs
+++ b/src/libsyntax/attr.rs
@@ -91,7 +91,7 @@ fn attr_meta(attr: ast::attribute) -> @ast::meta_item { @attr.node.value }
 // Get the meta_items from inside a vector of attributes
 fn attr_metas(attrs: ~[ast::attribute]) -> ~[@ast::meta_item] {
     let mut mitems = ~[];
-    for attrs.each |a| { vec::push(mitems, attr_meta(*a)); }
+    for attrs.each |a| { mitems.push(attr_meta(*a)); }
     return mitems;
 }
 
@@ -163,9 +163,9 @@ fn get_name_value_str_pair(item: @ast::meta_item) -> Option<(~str, ~str)> {
 fn find_attrs_by_name(attrs: ~[ast::attribute], name: ~str) ->
    ~[ast::attribute] {
     let filter = (
-        fn@(a: ast::attribute) -> Option<ast::attribute> {
-            if get_attr_name(a) == name {
-                option::Some(a)
+        fn@(a: &ast::attribute) -> Option<ast::attribute> {
+            if get_attr_name(*a) == name {
+                option::Some(*a)
             } else { option::None }
         }
     );
@@ -175,9 +175,9 @@ fn find_attrs_by_name(attrs: ~[ast::attribute], name: ~str) ->
 /// Searcha list of meta items and return only those with a specific name
 fn find_meta_items_by_name(metas: ~[@ast::meta_item], name: ~str) ->
    ~[@ast::meta_item] {
-    let filter = fn@(&&m: @ast::meta_item) -> Option<@ast::meta_item> {
-        if get_meta_item_name(m) == name {
-            option::Some(m)
+    let filter = fn@(m: &@ast::meta_item) -> Option<@ast::meta_item> {
+        if get_meta_item_name(*m) == name {
+            option::Some(*m)
         } else { option::None }
     };
     return vec::filter_map(metas, filter);
@@ -289,8 +289,8 @@ fn remove_meta_items_by_name(items: ~[@ast::meta_item], name: ~str) ->
    ~[@ast::meta_item] {
 
     return vec::filter_map(items, |item| {
-        if get_meta_item_name(item) != name {
-            option::Some(/* FIXME (#2543) */ copy item)
+        if get_meta_item_name(*item) != name {
+            option::Some(/* FIXME (#2543) */ copy *item)
         } else {
             option::None
         }