Made some minor improvements suggested by clippy
This commit is contained in:
parent
8be0c0a21b
commit
5c2fbf995a
|
|
@ -64,7 +64,7 @@ fn parse_args() -> CommandLineParameters {
|
|||
let mut size_iter = matches.values_of("size").unwrap();
|
||||
let width = size_iter.next().unwrap().parse().unwrap();
|
||||
let height = size_iter.next().unwrap().parse().unwrap();
|
||||
let output_file = matches.value_of_os("output_png").map(|f| PathBuf::from(f));
|
||||
let output_file = matches.value_of_os("output_png").map(PathBuf::from);
|
||||
let time = matches.value_of("time").unwrap().parse().unwrap();
|
||||
CommandLineParameters {
|
||||
width,
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ impl<T: Real> BoundingVolumeHierarchy<T> {
|
|||
.iter()
|
||||
.fold(BoundingBox::empty(), |acc, p| acc.union(&p.bounding_box()));
|
||||
if primitives.len() <= 1 {
|
||||
let primitives = primitives.iter().cloned().collect();
|
||||
let primitives = primitives.to_vec();
|
||||
BoundingVolumeHierarchy::Leaf { bounds, primitives }
|
||||
} else {
|
||||
let pivot = heuristic_split(primitives, &bounds);
|
||||
|
|
@ -116,7 +116,7 @@ impl<T: Real> Intersect<T> for BoundingVolumeHierarchy<T> {
|
|||
primitives
|
||||
.iter()
|
||||
.map(|elem| elem.intersect(&ray))
|
||||
.fold(None, |acc, elem| closest_intersection(acc, elem))
|
||||
.fold(None, closest_intersection)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue