Skip to content

Commit dd18b1d

Browse files
committed
Tweak variable name for MatchedPos values
1 parent d615490 commit dd18b1d

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/display/inline.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pub(crate) fn print(
1717
lhs_src: &str,
1818
rhs_src: &str,
1919
display_options: &DisplayOptions,
20-
lhs_positions: &[MatchedPos],
21-
rhs_positions: &[MatchedPos],
20+
lhs_mps: &[MatchedPos],
21+
rhs_mps: &[MatchedPos],
2222
hunks: &[Hunk],
2323
display_path: &str,
2424
extra_info: &Option<String>,
@@ -32,15 +32,15 @@ pub(crate) fn print(
3232
display_options.syntax_highlight,
3333
file_format,
3434
display_options.background_color,
35-
lhs_positions,
35+
lhs_mps,
3636
),
3737
apply_colors(
3838
rhs_src,
3939
Side::Right,
4040
display_options.syntax_highlight,
4141
file_format,
4242
display_options.background_color,
43-
rhs_positions,
43+
rhs_mps,
4444
),
4545
)
4646
} else {
@@ -63,8 +63,8 @@ pub(crate) fn print(
6363
.map(|line| style::replace_tabs(&line, display_options.tab_width))
6464
.collect();
6565

66-
let opposite_to_lhs = opposite_positions(lhs_positions);
67-
let opposite_to_rhs = opposite_positions(rhs_positions);
66+
let opposite_to_lhs = opposite_positions(lhs_mps);
67+
let opposite_to_rhs = opposite_positions(rhs_mps);
6868

6969
for (i, hunk) in hunks.iter().enumerate() {
7070
println!(

src/display/style.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,12 @@ pub(crate) fn color_positions(
329329
background: BackgroundColor,
330330
syntax_highlight: bool,
331331
file_format: &FileFormat,
332-
positions: &[MatchedPos],
332+
mps: &[MatchedPos],
333333
) -> Vec<(SingleLineSpan, Style)> {
334334
let mut styles = vec![];
335-
for pos in positions {
335+
for mp in mps {
336336
let mut style = Style::new();
337-
match pos.kind {
337+
match mp.kind {
338338
MatchKind::UnchangedToken { highlight, .. } | MatchKind::Ignored { highlight } => {
339339
if syntax_highlight {
340340
if let TokenKind::Atom(atom_kind) = highlight {
@@ -400,7 +400,7 @@ pub(crate) fn color_positions(
400400
}
401401
}
402402
};
403-
styles.push((pos.pos, style));
403+
styles.push((mp.pos, style));
404404
}
405405
styles
406406
}
@@ -411,9 +411,9 @@ pub(crate) fn apply_colors(
411411
syntax_highlight: bool,
412412
file_format: &FileFormat,
413413
background: BackgroundColor,
414-
positions: &[MatchedPos],
414+
mps: &[MatchedPos],
415415
) -> Vec<String> {
416-
let styles = color_positions(side, background, syntax_highlight, file_format, positions);
416+
let styles = color_positions(side, background, syntax_highlight, file_format, mps);
417417
let lines = split_on_newlines(s).collect::<Vec<_>>();
418418
style_lines(&lines, &styles)
419419
}

0 commit comments

Comments
 (0)