MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / equals

Method equals

crates/gitql-ast/src/types/composite.rs:35–54  ·  view source on GitHub ↗
(&self, other: &Box<dyn DataType>)

Source from the content-addressed store, hash-verified

33 }
34
35 fn equals(&self, other: &Box<dyn DataType>) -> bool {
36 if other.is_any() {
37 return true;
38 }
39
40 let composite_type: Box<dyn DataType> = Box::new(self.clone());
41 if other.is_variant_contains(&composite_type) {
42 return true;
43 }
44
45 if let Some(other_composite) = other.as_any().downcast_ref::<CompositeType>() {
46 if self.name.ne(&other_composite.name) {
47 return false;
48 }
49
50 return self.members.eq(&other_composite.members);
51 }
52
53 false
54 }
55
56 fn as_any(&self) -> &dyn Any {
57 self

Callers

nothing calls this directly

Calls 4

is_anyMethod · 0.80
is_variant_containsMethod · 0.80
as_anyMethod · 0.45
eqMethod · 0.45

Tested by

no test coverage detected