diff options
author | HampusM <hampus@hampusmat.com> | 2022-08-29 20:52:56 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-08-29 21:01:32 +0200 |
commit | 080cc42bb1da09059dbc35049a7ded0649961e0c (patch) | |
tree | 307ee564124373616022c1ba2b4d5af80845cd92 /src/libs/intertrait/mod.rs | |
parent | 6e31d8f9e46fece348f329763b39b9c6f2741c07 (diff) |
feat: implement async functionality
Diffstat (limited to 'src/libs/intertrait/mod.rs')
-rw-r--r-- | src/libs/intertrait/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libs/intertrait/mod.rs b/src/libs/intertrait/mod.rs index 2d62871..bdae4c7 100644 --- a/src/libs/intertrait/mod.rs +++ b/src/libs/intertrait/mod.rs @@ -23,7 +23,7 @@ //! MIT license (LICENSE-MIT or <http://opensource.org/licenses/MIT>) //! //! at your option. -use std::any::{Any, TypeId}; +use std::any::{type_name, Any, TypeId}; use std::rc::Rc; use std::sync::Arc; @@ -60,7 +60,10 @@ static CASTER_MAP: Lazy<AHashMap<(TypeId, TypeId), BoxedCaster>> = Lazy::new(|| fn cast_arc_panic<Trait: ?Sized + 'static>(_: Arc<dyn Any + Sync + Send>) -> Arc<Trait> { - panic!("Prepend [sync] to the list of target traits for Sync + Send types") + panic!( + "Interface trait '{}' has not been marked async", + type_name::<Trait>() + ) } /// A `Caster` knows how to cast a reference to or `Box` of a trait object for `Any` |