From a8851e1307cdae977ac49c2618a8a00e22000d28 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 21 Mar 2020 20:50:32 +0100 Subject: [PATCH] Hide methods from line_range --- src/line_range.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/line_range.rs b/src/line_range.rs index 45cb13b8..b7cfee5f 100644 --- a/src/line_range.rs +++ b/src/line_range.rs @@ -20,7 +20,7 @@ impl LineRange { LineRange::parse_range(range_raw) } - pub fn parse_range(range_raw: &str) -> Result { + fn parse_range(range_raw: &str) -> Result { 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);