mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
removed redundant method
- replaced with `try_compare`
This commit is contained in:
@@ -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>;
|
||||
|
||||
|
||||
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user