libcore: minor code cleanup.
This is minor and probably completely inconsequential to performance, but I find vec::map to be more clear than vec::each and a push.
This commit is contained in:
@@ -90,9 +90,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| { mitems.push(attr_meta(*a)); }
|
||||
return mitems;
|
||||
do attrs.map |a| { attr_meta(*a) }
|
||||
}
|
||||
|
||||
fn desugar_doc_attr(attr: &ast::attribute) -> ast::attribute {
|
||||
|
||||
Reference in New Issue
Block a user