diff --git a/src/context.rs b/src/context.rs index a409fb4ec..26610a198 100644 --- a/src/context.rs +++ b/src/context.rs @@ -216,9 +216,9 @@ pub fn calculate_context( Some(first_line) => match *first_line { (Some(lhs_line), _) => { let mut max_opposite = None; - for (_, rhs_line) in &before_lines { + for (_, rhs_line) in [&before_lines, lines].concat() { if let Some(rhs_line) = rhs_line { - max_opposite = Some(*rhs_line); + max_opposite = Some(rhs_line); } } @@ -232,9 +232,9 @@ pub fn calculate_context( } (_, Some(rhs_line)) => { let mut max_opposite = None; - for (lhs_line, _) in &before_lines { + for (lhs_line, _) in [&before_lines, lines].concat() { if let Some(lhs_line) = lhs_line { - max_opposite = Some(*lhs_line); + max_opposite = Some(lhs_line); } }