Skip to content

Commit

Permalink
Fix dozer.lock stability
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse-Bakker committed Oct 12, 2023
1 parent f7b89b2 commit 33ccf5e
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions dozer-cli/src/simple/build/contract/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,42 @@ where

impl PartialEq<PipelineContract> for PipelineContract {
fn eq(&self, other: &PipelineContract) -> bool {
dbg!(self, other);
is_isomorphic_matching(
self.0.graph(),
other.0.graph(),
PartialEq::eq,
PartialEq::eq,
|left, right| {
left.handle == right.handle
&& match (&left.kind, &right.kind) {
(
NodeKind::Source {
typ: left_typ,
port_names: left_portnames,
},
NodeKind::Source {
typ: right_typ,
port_names: right_portnames,
},
) => {
if left_typ != right_typ {
false
} else {
let mut left: Vec<_> = left_portnames.values().collect();
left.sort();
let mut right: Vec<_> = right_portnames.values().collect();
right.sort();
left == right
}
}
(
NodeKind::Processor { typ: left_typ },
NodeKind::Processor { typ: right_typ },
) => left_typ == right_typ,
(NodeKind::Sink, NodeKind::Sink) => true,
_ => false,
}
},
|left, right| left.schema == right.schema,
)
}
}
Expand Down

0 comments on commit 33ccf5e

Please sign in to comment.