diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-03-07 17:43:42 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-03-07 18:13:41 +0000 |
| commit | 775bacd1b8d97ade32c8d74ce35be1f34759aead (patch) | |
| tree | 774e3a2e4f0b44a136fe7e4623d390cc1a688880 /compiler/rustc_parse/src | |
| parent | ac4379fea9e83465d814bb05005689f49bd2141e (diff) | |
| download | rust-775bacd1b8d97ade32c8d74ce35be1f34759aead.tar.gz rust-775bacd1b8d97ade32c8d74ce35be1f34759aead.zip | |
Simplify `sort_by` calls
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/lexer/diagnostics.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/lexer/diagnostics.rs b/compiler/rustc_parse/src/lexer/diagnostics.rs index 27f4428d306..c4b9fdc81c5 100644 --- a/compiler/rustc_parse/src/lexer/diagnostics.rs +++ b/compiler/rustc_parse/src/lexer/diagnostics.rs @@ -71,7 +71,7 @@ pub fn report_suspicious_mismatch_block( .collect(); // sort by `lo`, so the large block spans in the front - matched_spans.sort_by(|a, b| a.0.lo().cmp(&b.0.lo())); + matched_spans.sort_by_key(|(span, _)| span.lo()); // We use larger block whose identation is well to cover those inner mismatched blocks // O(N^2) here, but we are on error reporting path, so it is fine |
