removed redundant method

- replaced with `try_compare`
This commit is contained in:
Dmitry Stepanov
2026-06-12 22:12:08 +03:00
parent ca6b3d5341
commit 589a08a928
2 changed files with 1 additions and 11 deletions
-3
View File
@@ -42,9 +42,6 @@ pub trait ReflectInheritableVariable: Reflect {
/// Returns true if value was modified.
fn is_modified(&self) -> bool;
/// Returns true if value equals to other's value.
fn value_equals(&self, other: &dyn ReflectInheritableVariable) -> bool;
/// Clones self value.
fn clone_value_box(&self) -> Box<dyn Reflect>;
+1 -8
View File
@@ -561,13 +561,6 @@ where
self.is_modified()
}
#[inline]
fn value_equals(&self, other: &dyn ReflectInheritableVariable) -> bool {
(other as &dyn Reflect)
.downcast_ref::<Self>()
.is_some_and(|v| v == self)
}
#[inline]
fn clone_value_box(&self) -> Box<dyn Reflect> {
Box::new(self.value.clone())
@@ -803,7 +796,7 @@ mod test {
let va = InheritableVariable::new_non_modified(1.23);
let vb = InheritableVariable::new_non_modified(1.23);
assert!(va.value_equals(&vb))
assert!(va.try_compare(&vb).unwrap())
}
#[derive(Reflect, PartialEq, Clone, Debug)]