summaryrefslogtreecommitdiff
path: root/src/rust/protover/protoset.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rust/protover/protoset.rs')
-rw-r--r--src/rust/protover/protoset.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rust/protover/protoset.rs b/src/rust/protover/protoset.rs
index f94e6299c9..4afc50edf8 100644
--- a/src/rust/protover/protoset.rs
+++ b/src/rust/protover/protoset.rs
@@ -8,7 +8,6 @@ use std::slice;
use std::str::FromStr;
use std::u32;
-use protover::MAX_PROTOCOLS_TO_EXPAND;
use errors::ProtoverError;
/// A single version number.
@@ -183,10 +182,6 @@ impl ProtoSet {
last_high = high;
}
- if self.len() > MAX_PROTOCOLS_TO_EXPAND {
- return Err(ProtoverError::ExceedsMax);
- }
-
Ok(self)
}
@@ -317,9 +312,15 @@ impl FromStr for ProtoSet {
/// assert!(protoset.contains(&5));
/// assert!(!protoset.contains(&10));
///
- /// // We can also equivalently call `ProtoSet::from_str` by doing:
+ /// // We can also equivalently call `ProtoSet::from_str` by doing (all
+ /// // implementations of `FromStr` can be called this way, this one isn't
+ /// // special):
/// let protoset: ProtoSet = "4-6,12".parse()?;
///
+ /// // Calling it (either way) can take really large ranges (up to `u32::MAX`):
+ /// let protoset: ProtoSet = "1-70000".parse()?;
+ /// let protoset: ProtoSet = "1-4294967296".parse()?;
+ ///
/// // There are lots of ways to get an `Err` from this function. Here are
/// // a few:
/// assert_eq!(Err(ProtoverError::Unparseable), ProtoSet::from_str("="));
@@ -327,7 +328,6 @@ impl FromStr for ProtoSet {
/// assert_eq!(Err(ProtoverError::Unparseable), ProtoSet::from_str("not_an_int"));
/// assert_eq!(Err(ProtoverError::Unparseable), ProtoSet::from_str("3-"));
/// assert_eq!(Err(ProtoverError::Unparseable), ProtoSet::from_str("1-,4"));
- /// assert_eq!(Err(ProtoverError::ExceedsMax), ProtoSet::from_str("1-70000"));
///
/// // Things which would get parsed into an _empty_ `ProtoSet` are,
/// // however, legal, and result in an empty `ProtoSet`: