diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-12-20 14:42:00 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-12-22 18:16:50 +1100 |
| commit | 2e8c522c6206eacb8f8d5e2d30590c4080cbed7a (patch) | |
| tree | 93ebeaa7880139d5ec21114aeec644c872b9c254 /src/libsyntax | |
| parent | 1b1e4caa79077d48c1bf56bf5bfa7bfc83fdf941 (diff) | |
| download | rust-2e8c522c6206eacb8f8d5e2d30590c4080cbed7a.tar.gz rust-2e8c522c6206eacb8f8d5e2d30590c4080cbed7a.zip | |
std::vec: make the sorting closure use `Ordering` rather than just being
(implicitly) less_eq.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/attr.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 4564542f929..8dff321ca0e 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -203,11 +203,7 @@ 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. + v.sort_by(|&(a, _), &(b, _)| a.cmp(&b)); // There doesn't seem to be a more optimal way to do this v.move_iter().map(|(_, m)| { |
