From 57eedbaaf8d2b789fbb3348589af0a43b98e40b8 Mon Sep 17 00:00:00 2001 From: varkor Date: Fri, 30 Mar 2018 10:54:14 +0100 Subject: Convert sort_by to sort_by_cached_key --- src/libsyntax/parse/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsyntax/parse') 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::>(); - 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(); -- cgit 1.4.1-3-g733a5