1
Fork 0

Use pattern matching instead of indexing tuples

This commit is contained in:
AnthonyMikh 2019-10-01 01:12:36 +03:00 committed by GitHub
parent 55b54285c8
commit bb442881fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1734,10 +1734,8 @@ impl FileWithAnnotatedLines {
// Find overlapping multiline annotations, put them at different depths
multiline_annotations.sort_by_key(|&(_, ref ml)| (ml.line_start, ml.line_end));
for item in multiline_annotations.clone() {
let ann = item.1;
for item in multiline_annotations.iter_mut() {
let ref mut a = item.1;
for (_, ann) in multiline_annotations.clone() {
for (_, a) in multiline_annotations.iter_mut() {
// Move all other multiline annotations overlapping with this one
// one level to the right.
if !(ann.same_span(a)) &&