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

View File

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

View File

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