Use a slightly prettier syntax in max_weight
This commit is contained in:
parent
01de0cafc5
commit
6e755eee4d
|
@ -117,9 +117,10 @@ impl std::ops::Mul<u32> 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
|
||||
|
|
Loading…
Reference in New Issue