Clippy lint.

This commit is contained in:
2018-09-22 12:25:22 -07:00
parent fecd7b6a00
commit e1c430b9b2
2 changed files with 5 additions and 8 deletions

View File

@@ -25,10 +25,7 @@ fn vec_first_into<T>(v: Vec<T>) -> T {
v.len()
));
}
for i in v.into_iter() {
return i;
}
panic!("Unreachable");
v.into_iter().next().unwrap()
}
fn vec_split_into<T>(v: Vec<T>, offset: usize) -> (Vec<T>, Vec<T>) {
@@ -167,9 +164,9 @@ impl Hit for KDTree {
None => None,
Some(_bbox) => match (left.hit(r, t_min, t_max), right.hit(r, t_min, t_max)) {
(Some(hit_left), Some(hit_right)) => if hit_left.t < hit_right.t {
return Some(hit_left);
Some(hit_left)
} else {
return Some(hit_right);
Some(hit_right)
},
(Some(hit_left), None) => Some(hit_left),
(None, Some(hit_right)) => Some(hit_right),