[tor-commits] [tor/master] rust/protover: remove redundant ExceedsMax checks

nickm at torproject.org nickm at torproject.org
Fri Oct 19 18:20:48 UTC 2018


commit b91bc1babc521abe1497fd913e4fe3fb5a909612
Author: cypherpunks <cypherpunks at torproject.org>
Date:   Sat Aug 18 20:07:16 2018 +0000

    rust/protover: remove redundant ExceedsMax checks
    
    This is already checked elsewhere.
---
 src/rust/protover/protoset.rs | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/rust/protover/protoset.rs b/src/rust/protover/protoset.rs
index 7576324c9..4f603a33c 100644
--- a/src/rust/protover/protoset.rs
+++ b/src/rust/protover/protoset.rs
@@ -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));
             }
         }





More information about the tor-commits mailing list