diff --git a/src/proptest/mod.rs b/src/proptest/mod.rs index 093e1525..56c0f9cf 100644 --- a/src/proptest/mod.rs +++ b/src/proptest/mod.rs @@ -169,7 +169,7 @@ pub struct MatrixParameters { /// ranges such as `5 ..= 6`. The latter example corresponds to dimensions from (inclusive) /// `Dynamic::new(5)` to `Dynamic::new(6)` (inclusive). #[derive(Debug, Clone, PartialEq, Eq)] -pub struct DimRange(RangeInclusive); +pub struct DimRange(RangeInclusive); impl DimRange { /// The lower bound for dimensions generated. @@ -201,6 +201,13 @@ impl From> for DimRange { } } +impl DimRange { + /// Converts the `DimRange` into an instance of `RangeInclusive`. + pub fn to_range_inclusive(&self) -> RangeInclusive { + self.lower_bound().value() ..= self.upper_bound().value() + } +} + impl From for DimRange { fn from(dim: usize) -> Self { DimRange::from(Dynamic::new(dim))