diff options
author | HampusM <hampus@hampusmat.com> | 2022-07-21 20:17:03 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-07-21 20:17:03 +0200 |
commit | 41b195c28cdb82854b8c97ecb8bf11c722da07cb (patch) | |
tree | 2223333f0221a65e1c80aef15864323da87ea9d3 | |
parent | a78b75e64cbb7cf79d4a7405f3ba41570fedbfd7 (diff) |
refactor: re-export dependency of error_stack
-rw-r--r-- | examples/basic/main.rs | 10 | ||||
-rw-r--r-- | macros/src/injectable_impl.rs | 4 | ||||
-rw-r--r-- | src/libs/mod.rs | 1 |
3 files changed, 6 insertions, 9 deletions
diff --git a/examples/basic/main.rs b/examples/basic/main.rs index 956b79e..f96d963 100644 --- a/examples/basic/main.rs +++ b/examples/basic/main.rs @@ -2,8 +2,6 @@ #![deny(clippy::pedantic)] #![allow(clippy::module_name_repetitions)] -use syrette::errors::di_container::DIContainerError; - mod animals; mod bootstrap; mod interfaces; @@ -12,19 +10,17 @@ use bootstrap::bootstrap; use interfaces::dog::IDog; use interfaces::human::IHuman; -fn main() -> error_stack::Result<(), DIContainerError> +fn main() { println!("Hello, world!"); let di_container = bootstrap(); - let dog = di_container.get::<dyn IDog>()?; + let dog = di_container.get::<dyn IDog>().unwrap(); dog.woof(); - let human = di_container.get::<dyn IHuman>()?; + let human = di_container.get::<dyn IHuman>().unwrap(); human.make_pets_make_sounds(); - - Ok(()) } diff --git a/macros/src/injectable_impl.rs b/macros/src/injectable_impl.rs index 3000253..8bb6c7a 100644 --- a/macros/src/injectable_impl.rs +++ b/macros/src/injectable_impl.rs @@ -52,11 +52,11 @@ impl InjectableImpl impl syrette::interfaces::injectable::Injectable for #self_type { fn resolve( #di_container_var: &syrette::DIContainer - ) -> error_stack::Result< + ) -> syrette::libs::error_stack::Result< syrette::ptr::InterfacePtr<Self>, syrette::errors::injectable::ResolveError> { - use error_stack::ResultExt; + use syrette::libs::error_stack::ResultExt; return Ok(syrette::ptr::InterfacePtr::new(Self::new( #(#get_dependencies diff --git a/src/libs/mod.rs b/src/libs/mod.rs index 8d5583d..034d11d 100644 --- a/src/libs/mod.rs +++ b/src/libs/mod.rs @@ -1,3 +1,4 @@ pub mod intertrait; +pub extern crate error_stack; pub extern crate linkme; |