From 613cd7129439d04f576325bcf55d276847efb136 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 24 Jul 2022 11:02:33 +0200 Subject: refactor: clean up intertrait lib --- src/libs/intertrait/cast_rc.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libs/intertrait/cast_rc.rs') diff --git a/src/libs/intertrait/cast_rc.rs b/src/libs/intertrait/cast_rc.rs index 79d8d60..5901b5e 100644 --- a/src/libs/intertrait/cast_rc.rs +++ b/src/libs/intertrait/cast_rc.rs @@ -17,16 +17,16 @@ use crate::libs::intertrait::{caster, CastFrom}; pub trait CastRc { - /// Casts an `Rc` for this trait into that for type `T`. - fn cast(self: Rc) -> Result, Rc>; + /// Casts an `Rc` for this trait into that for `Trait`. + fn cast(self: Rc) -> Result, Rc>; } /// A blanket implementation of `CastRc` for traits extending `CastFrom`. -impl CastRc for S +impl CastRc for CastableFrom { - fn cast(self: Rc) -> Result, Rc> + fn cast(self: Rc) -> Result, Rc> { - match caster::((*self).type_id()) { + match caster::((*self).type_id()) { Some(caster) => Ok((caster.cast_rc)(self.rc_any())), None => Err(self), } -- cgit v1.2.3-18-g5258