diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-12-19 23:03:11 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-12-21 09:35:18 +1100 |
| commit | 1b1e4caa79077d48c1bf56bf5bfa7bfc83fdf941 (patch) | |
| tree | 932fade0a40ca5fe22eca4c302adadae3df91b4a /src/libsyntax | |
| parent | 48fedcb36ffdb4248c238a1bfa7a846e6e27cb68 (diff) | |
| download | rust-1b1e4caa79077d48c1bf56bf5bfa7bfc83fdf941.tar.gz rust-1b1e4caa79077d48c1bf56bf5bfa7bfc83fdf941.zip | |
std::vec: add a sugary .sort() method for plain Ord sorting.
This moves the custom sorting to `.sort_by`.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/attr.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 9b616781d4f..4564542f929 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -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)| { |
