Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed May 16, 2022
1 parent c761093 commit 870a7a3
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions crates/fj-kernel/src/topology/cycles.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::hash::{Hash, Hasher};

use crate::shape::{Handle, LocalForm, Shape};

use super::{CycleBuilder, Edge};
Expand All @@ -19,7 +17,7 @@ use super::{CycleBuilder, Edge};
///
/// A cycle that is part of a [`Shape`] must be structurally sound. That means
/// the edges it refers to, must be part of the same shape.
#[derive(Clone, Debug, Eq, Ord, PartialOrd)]
#[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub struct Cycle<const D: usize> {
/// The edges that make up the cycle
pub edges: Vec<LocalForm<Edge<D>, Edge<3>>>,
Expand All @@ -46,17 +44,3 @@ impl Cycle<3> {
self.edges.iter().map(|handle| handle.canonical().get())
}
}

impl<const D: usize> PartialEq for Cycle<D> {
fn eq(&self, other: &Self) -> bool {
self.edges == other.edges
}
}

impl<const D: usize> Hash for Cycle<D> {
fn hash<H: Hasher>(&self, state: &mut H) {
for edge in &self.edges {
edge.hash(state);
}
}
}

0 comments on commit 870a7a3

Please sign in to comment.