diff --git a/src/geometry/primitive.rs b/src/geometry/primitive.rs index 0fed7cc..bc37e1b 100644 --- a/src/geometry/primitive.rs +++ b/src/geometry/primitive.rs @@ -149,7 +149,7 @@ impl SegShape { polygon![p1.0, p2.0, p3.0, p4.0] } - pub(crate) fn middle_line(&self) -> Line { + pub fn middle_line(&self) -> Line { Line { start: self.from.into(), end: self.to.into(), diff --git a/src/layout/layout.rs b/src/layout/layout.rs index d56e9e9..2b24e91 100644 --- a/src/layout/layout.rs +++ b/src/layout/layout.rs @@ -363,7 +363,7 @@ impl Layout { _ => None, } } - NodeIndex::Compound(cwidx) => Some(self.node_shape(node).center()), + NodeIndex::Compound(_) => Some(self.node_shape(node).center()), } } @@ -416,9 +416,9 @@ impl Layout { .map(|loose| { let prim: PrimitiveIndex = loose.into(); let shape = prim.primitive(&self.drawing).shape(); - (prim, loose, shape) + (loose, shape) }) - .filter_map(|(prim, loose, shape)| { + .filter_map(|(loose, shape)| { let band_uid = self.drawing.loose_band_uid(loose); let loose_hline = orig_hline.orthogonal_through(&match shape { PrimitiveShape::Seg(seg) => { @@ -443,11 +443,9 @@ impl Layout { shape, location ); - if 0.0 <= location && location <= 1.0 { - Some((location, band_uid)) - } else { - None - } + (0.0..=1.0) + .contains(&location) + .then_some((location, band_uid)) }) .collect(); bands.sort_by(|a, b| f64::total_cmp(&a.0, &b.0));