std::vec: add a sugary .sort() method for plain Ord sorting.

This moves the custom sorting to `.sort_by`.
This commit is contained in:
Huon Wilson
2013-12-19 23:03:11 +11:00
parent 48fedcb36f
commit 1b1e4caa79
16 changed files with 91 additions and 27 deletions

View File

@@ -203,7 +203,11 @@ pub fn sort_meta_items(items: &[@MetaItem]) -> ~[@MetaItem] {
.map(|&mi| (mi.name(), mi))
.collect::<~[(@str, @MetaItem)]>();
<<<<<<< HEAD
v.sort(|&(a, _), &(b, _)| a <= b);
=======
v.sort_by(|&(a, _): &(@str, @MetaItem), &(b, _): &(@str, @MetaItem)| a <= b);
>>>>>>> 9ceda35... std::vec: add a sugary .sort() method for plain Ord sorting.
// There doesn't seem to be a more optimal way to do this
v.move_iter().map(|(_, m)| {