diff options
author | HampusM <hampus@hampusmat.com> | 2022-08-28 13:24:39 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-08-28 13:37:14 +0200 |
commit | f91c4ce73786a69e4ec72f69ef4d9d5f03ac5886 (patch) | |
tree | 6ac016e731eaf7e6fabdbcf12b84852cbc5af475 /src/di_container.rs | |
parent | dd6ae0c8643f08114469ccff66615b45ccf5e13e (diff) |
style: add rustfmt config options
Diffstat (limited to 'src/di_container.rs')
-rw-r--r-- | src/di_container.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/di_container.rs b/src/di_container.rs index 9d54261..e42175b 100644 --- a/src/di_container.rs +++ b/src/di_container.rs @@ -5,7 +5,7 @@ //! use std::collections::HashMap; //! use std::error::Error; //! -//! use syrette::{DIContainer, injectable}; +//! use syrette::{injectable, DIContainer}; //! //! trait IDatabaseService //! { @@ -36,13 +36,15 @@ //! { //! let mut di_container = DIContainer::new(); //! -//! di_container.bind::<dyn IDatabaseService>().to::<DatabaseService>().map_err(|err| { -//! err.to_string() -//! })?; +//! di_container +//! .bind::<dyn IDatabaseService>() +//! .to::<DatabaseService>() +//! .map_err(|err| err.to_string())?; //! -//! let database_service = di_container.get::<dyn IDatabaseService>().map_err(|err| { -//! err.to_string() -//! })?.transient()?; +//! let database_service = di_container +//! .get::<dyn IDatabaseService>() +//! .map_err(|err| err.to_string())? +//! .transient()?; //! //! Ok(()) //! } @@ -54,7 +56,9 @@ use std::marker::PhantomData; use crate::castable_factory::CastableFactory; use crate::di_container_binding_map::DIContainerBindingMap; use crate::errors::di_container::{ - BindingBuilderError, BindingScopeConfiguratorError, BindingWhenConfiguratorError, + BindingBuilderError, + BindingScopeConfiguratorError, + BindingWhenConfiguratorError, DIContainerError, }; use crate::interfaces::injectable::Injectable; |