aboutsummaryrefslogtreecommitdiff
path: root/src/provider.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/provider.rs')
-rw-r--r--src/provider.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/provider.rs b/src/provider.rs
index ad94589..13674b9 100644
--- a/src/provider.rs
+++ b/src/provider.rs
@@ -2,9 +2,8 @@
use std::marker::PhantomData;
use crate::errors::injectable::InjectableError;
-use crate::interfaces::any_factory::AnyFactory;
use crate::interfaces::injectable::Injectable;
-use crate::ptr::{FactoryPtr, SingletonPtr, TransientPtr};
+use crate::ptr::{SingletonPtr, TransientPtr};
use crate::DIContainer;
#[derive(strum_macros::Display, Debug)]
@@ -12,8 +11,8 @@ pub enum Providable
{
Transient(TransientPtr<dyn Injectable>),
Singleton(SingletonPtr<dyn Injectable>),
- #[allow(dead_code)]
- Factory(FactoryPtr<dyn AnyFactory>),
+ #[cfg(feature = "factory")]
+ Factory(crate::ptr::FactoryPtr<dyn crate::interfaces::any_factory::AnyFactory>),
}
pub trait IProvider
@@ -95,13 +94,15 @@ where
#[cfg(feature = "factory")]
pub struct FactoryProvider
{
- factory: FactoryPtr<dyn AnyFactory>,
+ factory: crate::ptr::FactoryPtr<dyn crate::interfaces::any_factory::AnyFactory>,
}
#[cfg(feature = "factory")]
impl FactoryProvider
{
- pub fn new(factory: FactoryPtr<dyn AnyFactory>) -> Self
+ pub fn new(
+ factory: crate::ptr::FactoryPtr<dyn crate::interfaces::any_factory::AnyFactory>,
+ ) -> Self
{
Self { factory }
}