diff options
| author | HampusM <hampus@hampusmat.com> | 2023-08-04 16:32:46 +0200 | 
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2023-08-04 16:32:46 +0200 | 
| commit | e0216c7cbf008f2867ef92955abce28dba27f5e3 (patch) | |
| tree | 92f1f25dad7691b781b621c84e21478e5d182847 /src/private/cast | |
| parent | 14e45fe9aa2431120cfd6a7240f8bb94e45e730d (diff) | |
refactor: rename CastFromSync to CastFromArc
Diffstat (limited to 'src/private/cast')
| -rw-r--r-- | src/private/cast/arc.rs | 4 | ||||
| -rw-r--r-- | src/private/cast/mod.rs | 10 | 
2 files changed, 7 insertions, 7 deletions
diff --git a/src/private/cast/arc.rs b/src/private/cast/arc.rs index 7ea8b49..1fbdf8b 100644 --- a/src/private/cast/arc.rs +++ b/src/private/cast/arc.rs @@ -13,7 +13,7 @@ use std::any::type_name;  use std::sync::Arc;  use crate::private::cast::error::CastError; -use crate::private::cast::{get_caster, CastFromSync}; +use crate::private::cast::{get_caster, CastFromArc};  pub trait CastArc  { @@ -23,7 +23,7 @@ pub trait CastArc  /// A blanket implementation of `CastArc` for traits extending `CastFrom`, `Sync`, and  /// `Send`. -impl<CastFromSelf: ?Sized + CastFromSync> CastArc for CastFromSelf +impl<CastFromSelf: ?Sized + CastFromArc> CastArc for CastFromSelf  {      fn cast<Dest: ?Sized + 'static>(self: Arc<Self>) -> Result<Arc<Dest>, CastError>      { diff --git a/src/private/cast/mod.rs b/src/private/cast/mod.rs index 0b80057..ddff2a4 100644 --- a/src/private/cast/mod.rs +++ b/src/private/cast/mod.rs @@ -153,7 +153,7 @@ pub trait CastFrom: Any + 'static      fn rc_any(self: Rc<Self>) -> Rc<dyn Any>;  } -/// `CastFromSync` must be extended by a trait that is `Any + Sync + Send + 'static` +/// This trait must be extended by a trait that is `Any + Sync + Send + 'static`  /// and wants to allow for casting into another trait behind references and smart pointers  /// especially including `Arc`.  /// @@ -163,11 +163,11 @@ pub trait CastFrom: Any + 'static  ///  /// # Examples  /// ```ignore -/// trait Source: CastFromSync { +/// trait Source: CastFromArc {  ///     ...  /// }  /// ``` -pub trait CastFromSync: CastFrom + Sync + Send + 'static +pub trait CastFromArc: CastFrom + Sync + Send + 'static  {      fn arc_any(self: Arc<Self>) -> Arc<dyn Any + Sync + Send + 'static>;  } @@ -198,7 +198,7 @@ impl CastFrom for dyn Any + 'static      }  } -impl<Source: Sized + Sync + Send + 'static> CastFromSync for Source +impl<Source: Sized + Sync + Send + 'static> CastFromArc for Source  {      fn arc_any(self: Arc<Self>) -> Arc<dyn Any + Sync + Send + 'static>      { @@ -219,7 +219,7 @@ impl CastFrom for dyn Any + Sync + Send + 'static      }  } -impl CastFromSync for dyn Any + Sync + Send + 'static +impl CastFromArc for dyn Any + Sync + Send + 'static  {      fn arc_any(self: Arc<Self>) -> Arc<dyn Any + Sync + Send + 'static>      {  | 
