about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2018-03-30 10:54:14 +0100
committervarkor <github@varkor.com>2018-04-09 16:44:19 +0100
commit57eedbaaf8d2b789fbb3348589af0a43b98e40b8 (patch)
treef4807fb6fb9a82f978bac0a9c65ab357fd8f2901 /src/libsyntax/parse/parser.rs
parent5cd0504d10230ec82ad1a6447db590a77b0eadb7 (diff)
downloadrust-57eedbaaf8d2b789fbb3348589af0a43b98e40b8.tar.gz
rust-57eedbaaf8d2b789fbb3348589af0a43b98e40b8.zip
Convert sort_by to sort_by_cached_key
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index e6da5bcaa3a..6ed7088d052 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -689,7 +689,7 @@ impl<'a> Parser<'a> {
                 .chain(inedible.iter().map(|x| TokenType::Token(x.clone())))
                 .chain(self.expected_tokens.iter().cloned())
                 .collect::<Vec<_>>();
-            expected.sort_by(|a, b| a.to_string().cmp(&b.to_string()));
+            expected.sort_by_cached_key(|x| x.to_string());
             expected.dedup();
             let expect = tokens_to_string(&expected[..]);
             let actual = self.this_token_to_string();