MCPcopy Create free account
hub / github.com/argumentcomputer/ix / compare

Method compare

crates/common/src/strong_ordering.rs:20–28  ·  view source on GitHub ↗
(self, other: Self)

Source from the content-addressed store, hash-verified

18 }
19
20 pub fn compare(self, other: Self) -> Self {
21 match self {
22 SOrd { strong: true, ordering: Ordering::Equal } => other,
23 SOrd { strong: false, ordering: Ordering::Equal } => {
24 SOrd { strong: false, ordering: other.ordering }
25 },
26 _ => self,
27 }
28 }
29
30 pub fn cmp<A: Ord>(x: &A, y: &A) -> Self {
31 SOrd { strong: true, ordering: x.cmp(y) }

Callers 15

eq_strong_then_ltFunction · 0.80
eq_strong_then_gtFunction · 0.80
eq_strong_then_eqFunction · 0.80
eq_weak_then_ltFunction · 0.80
eq_weak_then_eqFunction · 0.80
lt_strong_short_circuitsFunction · 0.80
gt_strong_short_circuitsFunction · 0.80
lt_weak_short_circuitsFunction · 0.80
compare_kunivFunction · 0.80
compare_kexprFunction · 0.80
compare_krec_ruleFunction · 0.80
compare_kindcFunction · 0.80

Calls

no outgoing calls

Tested by 8

eq_strong_then_ltFunction · 0.64
eq_strong_then_gtFunction · 0.64
eq_strong_then_eqFunction · 0.64
eq_weak_then_ltFunction · 0.64
eq_weak_then_eqFunction · 0.64
lt_strong_short_circuitsFunction · 0.64
gt_strong_short_circuitsFunction · 0.64
lt_weak_short_circuitsFunction · 0.64