summaryrefslogtreecommitdiff
path: root/ecs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs')
-rw-r--r--ecs/src/component.rs22
1 files changed, 3 insertions, 19 deletions
diff --git a/ecs/src/component.rs b/ecs/src/component.rs
index 46fbf8a..525bd98 100644
--- a/ecs/src/component.rs
+++ b/ecs/src/component.rs
@@ -50,12 +50,6 @@ pub trait Component: SystemInput + Any + TypeName
/// Returns the component UID of a component event for this component.
fn get_event_uid(&self, event_kind: ComponentEventKind) -> Uid;
- #[doc(hidden)]
- fn as_any_mut(&mut self) -> &mut dyn Any;
-
- #[doc(hidden)]
- fn as_any(&self) -> &dyn Any;
-
/// Returns whether the component `self` is optional.
fn self_is_optional(&self) -> bool
{
@@ -76,17 +70,17 @@ impl dyn Component
{
pub fn downcast_mut<Real: 'static>(&mut self) -> Option<&mut Real>
{
- self.as_any_mut().downcast_mut()
+ (self as &mut dyn Any).downcast_mut()
}
pub fn downcast_ref<Real: 'static>(&self) -> Option<&Real>
{
- self.as_any().downcast_ref()
+ (self as &dyn Any).downcast_ref()
}
pub fn is<Other: 'static>(&self) -> bool
{
- self.as_any().is::<Other>()
+ (self as &dyn Any).is::<Other>()
}
}
@@ -128,16 +122,6 @@ where
}
}
- fn as_any_mut(&mut self) -> &mut dyn Any
- {
- self
- }
-
- fn as_any(&self) -> &dyn Any
- {
- self
- }
-
fn self_is_optional(&self) -> bool
{
true