From 134857c42c3aaea8f9b2800e43887bcf343b2fad Mon Sep 17 00:00:00 2001 From: "Dr. Dystopia" Date: Fri, 9 Jul 2021 17:58:32 +0200 Subject: [PATCH] Resolve all '#[allow(clippy::logic_bug)]' error supressions --- world/src/site/settlement/building/skeleton.rs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/world/src/site/settlement/building/skeleton.rs b/world/src/site/settlement/building/skeleton.rs index adef23b829..f227a25f3d 100644 --- a/world/src/site/settlement/building/skeleton.rs +++ b/world/src/site/settlement/building/skeleton.rs @@ -72,7 +72,6 @@ impl Skeleton { bounds } - #[allow(clippy::logic_bug)] // TODO: Pending review in #587 pub fn sample_closest( &self, pos: Vec3, @@ -109,18 +108,10 @@ impl Skeleton { }; 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) }