From c1e682c25c24be3174d44ceb95b0537c38299d0c Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 12 Sep 2022 20:22:13 +0200 Subject: feat!: allow factories access to DI container BREAKING CHANGE: Factory types should now be written with the Fn trait instead of the IFactory trait and the to_factory & to_default_factory methods of BindingBuilder now expect a function returning a factory function --- examples/with-3rd-party/bootstrap.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'examples/with-3rd-party/bootstrap.rs') diff --git a/examples/with-3rd-party/bootstrap.rs b/examples/with-3rd-party/bootstrap.rs index a4bd84a..c5512c4 100644 --- a/examples/with-3rd-party/bootstrap.rs +++ b/examples/with-3rd-party/bootstrap.rs @@ -5,10 +5,7 @@ use syrette::ptr::TransientPtr; use syrette::{declare_default_factory, DIContainer}; use third_party_lib::Shuriken; -// Interfaces use crate::interfaces::ninja::INinja; -// -// Concrete implementations use crate::ninja::Ninja; declare_default_factory!(Shuriken); @@ -21,7 +18,7 @@ pub fn bootstrap() -> Result, Box> di_container .bind::() - .to_default_factory(&|| TransientPtr::new(Shuriken::new()))?; + .to_default_factory(&|_| TransientPtr::new(Shuriken::new()))?; Ok(di_container) } -- cgit v1.2.3-18-g5258