mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Merge pull request #2739 from thibaultdelor/fixWindowsTest
Fix test failing on windows due to crlf
This commit is contained in:
commit
0a2ec411ae
@ -209,9 +209,9 @@ impl FileLines {
|
||||
self.file_range_matches(file_name, |r| r.lo <= line && r.hi >= line)
|
||||
}
|
||||
|
||||
/// Returns true if any of the lines between `lo` and `hi` from `file_name` are in `self`.
|
||||
pub(crate) fn intersects_range(&self, file_name: &FileName, lo: usize, hi: usize) -> bool {
|
||||
self.file_range_matches(file_name, |r| r.intersects(Range::new(lo, hi)))
|
||||
/// Returns true if all the lines between `lo` and `hi` from `file_name` are in `self`.
|
||||
pub(crate) fn contains_range(&self, file_name: &FileName, lo: usize, hi: usize) -> bool {
|
||||
self.file_range_matches(file_name, |r| r.contains(Range::new(lo, hi)))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ impl<'a> FmtVisitor<'a> {
|
||||
debug!("{:?}: {:?}", kind, subslice);
|
||||
|
||||
let newline_count = count_newlines(subslice);
|
||||
let within_file_lines_range = self.config.file_lines().intersects_range(
|
||||
let within_file_lines_range = self.config.file_lines().contains_range(
|
||||
file_name,
|
||||
status.cur_line,
|
||||
status.cur_line + newline_count,
|
||||
|
Loading…
Reference in New Issue
Block a user