[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] slight improvement to rust idiomicity



commit 039a77636730633e12410d42191f13dbdf5aea50
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu Nov 9 09:48:52 2017 -0500

    slight improvement to rust idiomicity
---
 src/rust/protover/protover.rs | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/rust/protover/protover.rs b/src/rust/protover/protover.rs
index 85cdb3060..b8bf280d4 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

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits