Some minor cleanup recommended by clippy

This commit is contained in:
Matthew Gordon 2020-04-03 23:21:38 -04:00
parent 34232bb7d3
commit 5fbed4a17f
3 changed files with 8 additions and 9 deletions

View File

@ -69,11 +69,10 @@ impl<T: Real> BoundingVolumeHierarchy<T> {
right, right,
} }
} else if nodes.len() == 1 { } else if nodes.len() == 1 {
match nodes[0] { let (bounds, ref primitive) = nodes[0];
(bounds, ref primitive) => BoundingVolumeHierarchy::Leaf { BoundingVolumeHierarchy::Leaf {
bounds, bounds,
primitive: Arc::clone(primitive), primitive: Arc::clone(primitive),
},
} }
} else { } else {
BoundingVolumeHierarchy::None BoundingVolumeHierarchy::None
@ -202,7 +201,7 @@ impl<T: Real> Iterator for FilterIterator<'_, T> {
BoundingVolumeHierarchy::None => {} BoundingVolumeHierarchy::None => {}
} }
} }
return Option::None; Option::None
} }
} }

View File

@ -39,11 +39,11 @@ impl<T: Real> Interval<T> {
} }
pub fn get_min(&self) -> T { pub fn get_min(&self) -> T {
return self.min; self.min
} }
pub fn get_max(&self) -> T { pub fn get_max(&self) -> T {
return self.max; self.max
} }
pub fn is_degenerate(self) -> bool { pub fn is_degenerate(self) -> bool {

View File

@ -7,7 +7,7 @@ use crate::Real;
fn spread_bits(v: u32) -> u32 { fn spread_bits(v: u32) -> u32 {
let mut result = 0; let mut result = 0;
for power in 0..9 { for power in 0..9 {
result |= ((1 << power) & v) << power * 2; result |= ((1 << power) & v) << (power * 2);
} }
result result
} }