Merge branch 'tygyh/Resolve-all-'#-allow(clippy--logic_bug)]'-error-supressions' into 'master'

Resolve all '#[allow(clippy::logic_bug)]' error supressions

See merge request veloren/veloren!2624
This commit is contained in:
Marcel 2021-07-17 23:46:28 +00:00
commit ecdd95ee49

View File

@ -72,7 +72,6 @@ impl<T> Skeleton<T> {
bounds
}
#[allow(clippy::logic_bug)] // TODO: Pending review in #587
pub fn sample_closest(
&self,
pos: Vec3<i32>,
@ -109,18 +108,10 @@ impl<T> Skeleton<T> {
};
let dist = bound_offset.reduce_max();
let dist_locus = dist - branch.locus;
if !is_child
|| match ori {
Ori::East => (pos.x - node.x) * branch.len.signum() >= 0,
Ori::North => (pos.y - node.y) * branch.len.signum() >= 0,
}
|| true
{
let new_bm = f(pos, dist, bound_offset, center_offset, ori, branch);
min = min
.map(|(_, bm)| (dist_locus, bm.resolve_with(new_bm)))
.or(Some((dist_locus, new_bm)));
}
let new_bm = f(pos, dist, bound_offset, center_offset, ori, branch);
min = min
.map(|(_, bm)| (dist_locus, bm.resolve_with(new_bm)))
.or(Some((dist_locus, new_bm)));
});
min.map(|(_, bm)| bm).unwrap_or_else(BlockMask::nothing)
}