diff options
author | HampusM <hampus@hampusmat.com> | 2023-09-14 22:00:34 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-09-14 22:01:32 +0200 |
commit | 88a6d31399bd14da6574471a8df4423e63ef340f (patch) | |
tree | a33ec9299f6cc632419dd2c8c837b9380689c851 | |
parent | 9bed6b4d2772fd020ea9eb6eaaba4ca014d96f94 (diff) |
refactor!: remove blocking DI container prelude module
BREAKING CHANGE: The blocking DI container prelude module have been removed as it is no longer necessary seeing as the blocking DI container interface have been removed
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | examples/basic/bootstrap.rs | 2 | ||||
-rw-r--r-- | examples/factory/bootstrap.rs | 2 | ||||
-rw-r--r-- | examples/generics/bootstrap.rs | 3 | ||||
-rw-r--r-- | examples/named/bootstrap.rs | 2 | ||||
-rw-r--r-- | examples/with-3rd-party/bootstrap.rs | 3 | ||||
-rw-r--r-- | src/di_container/blocking/mod.rs | 1 | ||||
-rw-r--r-- | src/di_container/blocking/prelude.rs | 2 | ||||
-rw-r--r-- | src/lib.rs | 3 | ||||
-rw-r--r-- | tests/prevent_circular.rs | 3 |
10 files changed, 8 insertions, 15 deletions
@@ -92,7 +92,7 @@ The goal of Syrette is to be a simple, useful, convenient and familiar DI & IoC use std::error::Error; use syrette::injectable; -use syrette::di_container::blocking::prelude::*; +use syrette::DIContainer; use syrette::ptr::TransientPtr; trait IWeapon diff --git a/examples/basic/bootstrap.rs b/examples/basic/bootstrap.rs index 1cad500..2c45676 100644 --- a/examples/basic/bootstrap.rs +++ b/examples/basic/bootstrap.rs @@ -1,7 +1,7 @@ use std::error::Error; use std::rc::Rc; -use syrette::di_container::blocking::prelude::*; +use syrette::DIContainer; use crate::animals::cat::Cat; use crate::animals::dog::Dog; diff --git a/examples/factory/bootstrap.rs b/examples/factory/bootstrap.rs index e535dd2..f8bef6e 100644 --- a/examples/factory/bootstrap.rs +++ b/examples/factory/bootstrap.rs @@ -1,8 +1,8 @@ use std::error::Error; use std::rc::Rc; -use syrette::di_container::blocking::prelude::*; use syrette::ptr::TransientPtr; +use syrette::DIContainer; use crate::interfaces::user::{IUser, IUserFactory}; use crate::interfaces::user_manager::IUserManager; diff --git a/examples/generics/bootstrap.rs b/examples/generics/bootstrap.rs index 4034aa8..98d03db 100644 --- a/examples/generics/bootstrap.rs +++ b/examples/generics/bootstrap.rs @@ -1,7 +1,6 @@ use std::rc::Rc; -use syrette::di_container::blocking::prelude::*; -use syrette::di_container_bind; +use syrette::{di_container_bind, DIContainer}; use crate::interfaces::printer::IPrinter; use crate::printer::Printer; diff --git a/examples/named/bootstrap.rs b/examples/named/bootstrap.rs index f7edc5d..5f63b47 100644 --- a/examples/named/bootstrap.rs +++ b/examples/named/bootstrap.rs @@ -1,7 +1,7 @@ use std::rc::Rc; use anyhow::Result; -use syrette::di_container::blocking::prelude::*; +use syrette::DIContainer; use crate::interfaces::ninja::INinja; use crate::interfaces::weapon::IWeapon; diff --git a/examples/with-3rd-party/bootstrap.rs b/examples/with-3rd-party/bootstrap.rs index 9a55eb1..4fea754 100644 --- a/examples/with-3rd-party/bootstrap.rs +++ b/examples/with-3rd-party/bootstrap.rs @@ -1,9 +1,8 @@ use std::error::Error; use std::rc::Rc; -use syrette::declare_default_factory; -use syrette::di_container::blocking::prelude::*; use syrette::ptr::TransientPtr; +use syrette::{declare_default_factory, DIContainer}; use third_party_lib::Shuriken; use crate::interfaces::ninja::INinja; diff --git a/src/di_container/blocking/mod.rs b/src/di_container/blocking/mod.rs index 169abd2..548f716 100644 --- a/src/di_container/blocking/mod.rs +++ b/src/di_container/blocking/mod.rs @@ -66,7 +66,6 @@ use crate::util::use_double; use_double!(crate::dependency_history::DependencyHistory); pub mod binding; -pub mod prelude; #[cfg(not(test))] pub(crate) type BindingOptionsWithLt<'a> = BindingOptions<'a>; diff --git a/src/di_container/blocking/prelude.rs b/src/di_container/blocking/prelude.rs deleted file mode 100644 index 216be4b..0000000 --- a/src/di_container/blocking/prelude.rs +++ /dev/null @@ -1,2 +0,0 @@ -//! Commonly used types. -pub use crate::di_container::blocking::DIContainer; @@ -13,9 +13,8 @@ //! ``` //! use std::error::Error; //! -//! use syrette::di_container::blocking::prelude::*; -//! use syrette::injectable; //! use syrette::ptr::TransientPtr; +//! use syrette::{injectable, DIContainer}; //! //! trait IWeapon //! { diff --git a/tests/prevent_circular.rs b/tests/prevent_circular.rs index 4b95dea..2abbac7 100644 --- a/tests/prevent_circular.rs +++ b/tests/prevent_circular.rs @@ -1,11 +1,10 @@ #![deny(clippy::all, clippy::pedantic)] #![allow(clippy::disallowed_names)] -use syrette::di_container::blocking::prelude::*; use syrette::errors::di_container::DIContainerError; use syrette::errors::injectable::InjectableError; -use syrette::injectable; use syrette::ptr::TransientPtr; +use syrette::{injectable, DIContainer}; #[derive(Debug)] struct Foo |