[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Merge remote-tracking branch 'onionk/rust-protocommas1' into maint-0.3.5
commit 1ae91166016ec70a242c6dbb14c9ca5e77b1313f
Merge: a5599fb71 b91bc1bab
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Fri Oct 19 14:20:57 2018 -0400
Merge remote-tracking branch 'onionk/rust-protocommas1' into maint-0.3.5
changes/bug27197 | 3 +++
src/rust/protover/protoset.rs | 33 ++++++++++++++++-----------------
2 files changed, 19 insertions(+), 17 deletions(-)
diff --cc src/rust/protover/protoset.rs
index 3bfa7815f,4f603a33c..aa8d243ba
--- a/src/rust/protover/protoset.rs
+++ b/src/rust/protover/protoset.rs
@@@ -366,20 -347,15 +370,15 @@@ impl FromStr for ProtoSet
let pieces: ::std::str::Split<char> = version_string.split(',');
for p in pieces {
- if p.is_empty() {
- continue;
- } else if p.contains('-') {
+ if p.contains('-') {
let mut pair = p.splitn(2, '-');
- let low = pair.next().ok_or(ProtoverError::Unparseable)?;
+ let low = pair.next().ok_or(ProtoverError::Unparseable)?;
let high = pair.next().ok_or(ProtoverError::Unparseable)?;
- let lo: Version = low.parse().or(Err(ProtoverError::Unparseable))?;
+ 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))?;
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits