Skip to content

Commit

Permalink
Remove redundant field from Cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Nov 2, 2022
1 parent e3b66c9 commit e86b115
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions crates/fj-kernel/src/objects/cycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use super::{HalfEdge, Surface};
/// A cycle of connected half-edges
#[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub struct Cycle {
surface: Handle<Surface>,
half_edges: Vec<Handle<HalfEdge>>,
}

Expand Down Expand Up @@ -68,15 +67,18 @@ impl Cycle {
}
}

Self {
surface,
half_edges,
}
Self { half_edges }
}

/// Access the surface that this cycle is in
pub fn surface(&self) -> &Handle<Surface> {
&self.surface
if let Some(half_edge) = self.half_edges.first() {
return half_edge.surface();
}

unreachable!(
"Cycle has no half-edges, which the constructor should prevent."
)
}

/// Access the half-edges that make up the cycle
Expand Down

0 comments on commit e86b115

Please sign in to comment.