@@ -130,8 +130,8 @@ impl Margin {
130
130
fn was_cut_right ( & self , line_len : usize ) -> bool {
131
131
let right =
132
132
if self . computed_right == self . span_right || self . computed_right == self . label_right {
133
- // Account for the "..." padding given above. Otherwise we end up with code lines that
134
- // do fit but end in "..." as if they were trimmed.
133
+ // Account for the "..." padding given above. Otherwise we end up with code lines
134
+ // that do fit but end in "..." as if they were trimmed.
135
135
self . computed_right - 6
136
136
} else {
137
137
self . computed_right
@@ -657,9 +657,9 @@ pub struct HumanEmitter {
657
657
}
658
658
659
659
#[ derive( Debug ) ]
660
- pub struct FileWithAnnotatedLines {
661
- pub file : Lrc < SourceFile > ,
662
- pub lines : Vec < Line > ,
660
+ pub ( crate ) struct FileWithAnnotatedLines {
661
+ pub ( crate ) file : Lrc < SourceFile > ,
662
+ pub ( crate ) lines : Vec < Line > ,
663
663
multiline_depth : usize ,
664
664
}
665
665
@@ -724,8 +724,9 @@ impl HumanEmitter {
724
724
. skip ( left)
725
725
. take_while ( |ch| {
726
726
// Make sure that the trimming on the right will fall within the terminal width.
727
- // FIXME: `unicode_width` sometimes disagrees with terminals on how wide a `char` is.
728
- // For now, just accept that sometimes the code line will be longer than desired.
727
+ // FIXME: `unicode_width` sometimes disagrees with terminals on how wide a `char`
728
+ // is. For now, just accept that sometimes the code line will be longer than
729
+ // desired.
729
730
let next = unicode_width:: UnicodeWidthChar :: width ( * ch) . unwrap_or ( 1 ) ;
730
731
if taken + next > right - left {
731
732
return false ;
@@ -2228,8 +2229,8 @@ impl HumanEmitter {
2228
2229
buffer. puts ( * row_num - 1 , max_line_num_len + 3 , & line, Style :: NoStyle ) ;
2229
2230
* row_num += 1 ;
2230
2231
}
2231
- // If the last line is exactly equal to the line we need to add, we can skip both of them.
2232
- // This allows us to avoid output like the following:
2232
+ // If the last line is exactly equal to the line we need to add, we can skip both of
2233
+ // them. This allows us to avoid output like the following:
2233
2234
// 2 - &
2234
2235
// 2 + if true { true } else { false }
2235
2236
// 3 - if true { true } else { false }
@@ -2586,6 +2587,7 @@ fn num_overlap(
2586
2587
let extra = if inclusive { 1 } else { 0 } ;
2587
2588
( b_start..b_end + extra) . contains ( & a_start) || ( a_start..a_end + extra) . contains ( & b_start)
2588
2589
}
2590
+
2589
2591
fn overlaps ( a1 : & Annotation , a2 : & Annotation , padding : usize ) -> bool {
2590
2592
num_overlap (
2591
2593
a1. start_col . display ,
0 commit comments