From cc4a5081e259ed798613175d116a34162bc657fa Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 3 Aug 2022 14:40:42 +0200 Subject: docs: correct examples --- README.md | 4 ++-- src/di_container.rs | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 50dc5ac..5ff2d88 100644 --- a/README.md +++ b/README.md @@ -92,9 +92,9 @@ fn main() { let mut di_container = DIContainer::new(); - di_container.bind::().to::(); + di_container.bind::().to::().unwrap(); - di_container.bind::().to::(); + di_container.bind::().to::().unwrap(); let warrior = di_container.get::().unwrap(); diff --git a/src/di_container.rs b/src/di_container.rs index 239a2cb..eaa0366 100644 --- a/src/di_container.rs +++ b/src/di_container.rs @@ -32,13 +32,17 @@ //! } //! } //! -//! fn main() -> error_stack::Result<(), DIContainerError> +//! fn main() -> Result<(), String> //! { //! let mut di_container = DIContainer::new(); //! -//! di_container.bind::().to::(); +//! di_container.bind::().to::().map_err(|err| { +//! err.to_string() +//! })?; //! -//! let database_service = di_container.get::()?; +//! let database_service = di_container.get::().map_err(|err| { +//! err.to_string() +//! })?; //! //! Ok(()) //! } -- cgit v1.2.3-18-g5258