Skip to content

Commit

Permalink
make SizeRange methods public
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed May 20, 2023
1 parent a6bc664 commit 6eb7574
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions proptest/src/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,23 @@ impl SizeRange {
self.with(Default::default())
}

pub(crate) fn start(&self) -> usize {
/// The lower bound of the range (inclusive).
pub fn start(&self) -> usize {
self.0.start
}

/// Extract the ends `[low, high]` of a `SizeRange`.
pub(crate) fn start_end_incl(&self) -> (usize, usize) {
pub fn start_end_incl(&self) -> (usize, usize) {
(self.start(), self.end_incl())
}

pub(crate) fn end_incl(&self) -> usize {
/// The upper bound of the range (inclusive).
pub fn end_incl(&self) -> usize {
self.0.end - 1
}

pub(crate) fn end_excl(&self) -> usize {
/// The upper bound of the range (exclusive).
pub fn end_excl(&self) -> usize {
self.0.end
}

Expand Down

0 comments on commit 6eb7574

Please sign in to comment.