Skip to content

Commit

Permalink
refactor: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
apskhem committed Mar 12, 2024
1 parent dfc5f9b commit 5872ae3
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/analyzer/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,8 @@ impl IndexedRef {
};

match (&self.rel, &other.rel) {
(Relation::Many2Many, Relation::Many2Many) => {
(Relation::Many2Many, Relation::Many2Many)
| (Relation::One2One, Relation::One2One) => {
[&self.lhs, &self.rhs].iter().all(|self_side| {
[&other.lhs, &other.rhs].iter().any(|other_side| {
let self_ident = indexer.resolve_ref_alias(self_side);
Expand Down Expand Up @@ -513,21 +514,12 @@ impl IndexedRef {

impl From<RefBlock> for IndexedRef {
fn from(ref_block: RefBlock) -> Self {
let RefBlock {
rel,
lhs,
rhs,
settings,
span_range,
name
} = ref_block;

Self {
span_range,
rel,
lhs,
rhs,
settings,
span_range: ref_block.span_range,
rel: ref_block.rel,
lhs: ref_block.lhs,
rhs: ref_block.rhs,
settings: ref_block.settings,
}
}
}

0 comments on commit 5872ae3

Please sign in to comment.