mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-26 20:16:33 +00:00
Hide methods from line_range
This commit is contained in:
1 parent
d4a39f99d2
commit
a8851e1307
1 file changed
+3
-4
+3
-4
@@ -20,7 +20,7 @@ impl LineRange {
|
||||
LineRange::parse_range(range_raw)
|
||||
}
|
||||
|
||||
pub fn parse_range(range_raw: &str) -> Result<LineRange> {
|
||||
fn parse_range(range_raw: &str) -> Result<LineRange> {
|
||||
let mut new_range = LineRange::default();
|
||||
|
||||
if range_raw.bytes().nth(0).ok_or("Empty line range")? == b':' {
|
||||
@@ -50,7 +50,7 @@ impl LineRange {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_inside(&self, line: usize) -> bool {
|
||||
pub(crate) fn is_inside(&self, line: usize) -> bool {
|
||||
line >= self.lower && line <= self.upper
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ impl LineRanges {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn check(&self, line: usize) -> RangeCheckResult {
|
||||
pub(crate) fn check(&self, line: usize) -> RangeCheckResult {
|
||||
if self.ranges.iter().any(|r| r.is_inside(line)) {
|
||||
RangeCheckResult::InRange
|
||||
} else if line < self.largest_upper_bound {
|
||||
@@ -149,7 +149,6 @@ impl Default for LineRanges {
|
||||
}
|
||||
}
|
||||
|
||||
/// Similar to LineRanges, but "empty" by default
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct HighlightedLineRanges(pub LineRanges);
|
||||
|
||||
|
||||
Reference in new issue
Block a user