mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
rust/protover: remove redundant ExceedsMax checks
This is already checked elsewhere.
This commit is contained in:
@@ -356,16 +356,10 @@ impl FromStr for ProtoSet {
|
||||
let lo: Version = low.parse().or(Err(ProtoverError::Unparseable))?;
|
||||
let hi: Version = high.parse().or(Err(ProtoverError::Unparseable))?;
|
||||
|
||||
if lo == u32::MAX || hi == u32::MAX {
|
||||
return Err(ProtoverError::ExceedsMax);
|
||||
}
|
||||
pairs.push((lo, hi));
|
||||
} else {
|
||||
let v: u32 = p.parse().or(Err(ProtoverError::Unparseable))?;
|
||||
|
||||
if v == u32::MAX {
|
||||
return Err(ProtoverError::ExceedsMax);
|
||||
}
|
||||
pairs.push((v, v));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user