mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
replacing sub's that can wrap by saturating_sub's
This commit is contained in:
@@ -959,15 +959,15 @@ fn render_source_line(
|
||||
'_',
|
||||
line_offset + pos,
|
||||
width_offset + depth,
|
||||
code_offset + annotation.start_col - left,
|
||||
(code_offset + annotation.start_col).saturating_sub(left),
|
||||
style,
|
||||
);
|
||||
}
|
||||
_ if self.teach => {
|
||||
buffer.set_style_range(
|
||||
line_offset,
|
||||
code_offset + annotation.start_col - left,
|
||||
code_offset + annotation.end_col - left,
|
||||
(code_offset + annotation.start_col).saturating_sub(left),
|
||||
(code_offset + annotation.end_col).saturating_sub(left),
|
||||
style,
|
||||
annotation.is_primary,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user