From 9e01cdf341a7866180b3a63d745f3b2d7578d28a Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 23 Oct 2022 18:12:23 +0200 Subject: refactor!: reduce DI container coupling BREAKING CHANGE: You now have to import the DI containers's interfaces to use the DI containers's methods --- examples/async/bootstrap.rs | 3 ++- examples/async/main.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'examples/async') diff --git a/examples/async/bootstrap.rs b/examples/async/bootstrap.rs index 9b495c2..5f90d88 100644 --- a/examples/async/bootstrap.rs +++ b/examples/async/bootstrap.rs @@ -1,8 +1,9 @@ use std::sync::Arc; use anyhow::Result; +use syrette::declare_default_factory; +use syrette::di_container::asynchronous::prelude::*; use syrette::ptr::TransientPtr; -use syrette::{declare_default_factory, AsyncDIContainer}; use crate::animals::cat::Cat; use crate::animals::dog::Dog; diff --git a/examples/async/main.rs b/examples/async/main.rs index 03e36e1..d051b94 100644 --- a/examples/async/main.rs +++ b/examples/async/main.rs @@ -2,19 +2,19 @@ #![deny(clippy::pedantic)] #![allow(clippy::module_name_repetitions)] -use anyhow::Result; -use tokio::spawn; - mod animals; mod bootstrap; mod food; mod interfaces; -use bootstrap::bootstrap; -use interfaces::dog::IDog; -use interfaces::human::IHuman; +use anyhow::Result; +use syrette::di_container::asynchronous::prelude::*; +use tokio::spawn; +use crate::bootstrap::bootstrap; +use crate::interfaces::dog::IDog; use crate::interfaces::food::IFoodFactory; +use crate::interfaces::human::IHuman; #[tokio::main] async fn main() -> Result<()> -- cgit v1.2.3-18-g5258