From 6e755eee4d30618b35ee11271e3a75180fe55c3a Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 2 Dec 2020 15:27:32 -0500 Subject: [PATCH] Use a slightly prettier syntax in max_weight --- tor-netdir/src/weight.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tor-netdir/src/weight.rs b/tor-netdir/src/weight.rs index 9d432bbd7..fc1e320c1 100644 --- a/tor-netdir/src/weight.rs +++ b/tor-netdir/src/weight.rs @@ -117,9 +117,10 @@ impl std::ops::Mul for RelayWeight { impl RelayWeight { /// Return the largest weight that we give for this kind of relay. fn max_weight(&self) -> u32 { - *[self.as_guard, self.as_middle, self.as_exit, self.as_dir] + [self.as_guard, self.as_middle, self.as_exit, self.as_dir] .iter() .max() + .copied() .unwrap() } /// Return the weight we should give this kind of relay's