diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-11-09 09:48:52 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-11-09 09:48:52 -0500 |
commit | 039a77636730633e12410d42191f13dbdf5aea50 (patch) | |
tree | 75912892ec7d92040753ee29add09814b30040e4 /src/rust | |
parent | c80bb04542b4a56f2c174b526006f6d3e402eecc (diff) | |
download | tor-039a77636730633e12410d42191f13dbdf5aea50.tar.gz tor-039a77636730633e12410d42191f13dbdf5aea50.zip |
slight improvement to rust idiomicity
Diffstat (limited to 'src/rust')
-rw-r--r-- | src/rust/protover/protover.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/rust/protover/protover.rs b/src/rust/protover/protover.rs index 85cdb3060a..b8bf280d4c 100644 --- a/src/rust/protover/protover.rs +++ b/src/rust/protover/protover.rs @@ -364,12 +364,7 @@ pub fn protover_string_supports_protocol_or_later( None => return false, }; - for v in supported_versions.iter() { - if v >= &vers { - return true; - } - } - return false; + supported_versions.iter().any(|v| v >= &vers) } /// Fully expand a version range. For example, 1-3 expands to 1,2,3 |