diff options
author | HampusM <hampus@hampusmat.com> | 2022-08-21 14:19:07 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-08-21 18:17:51 +0200 |
commit | 8c66b98bca6ed0a2990903fe8e0ea72def5c7be8 (patch) | |
tree | deed78171051262dba7e8d97eba73a9aaf04dd5e /examples/unbound/main.rs | |
parent | b3e1b993b028bbfa73638236cfbdb50ee478d3f0 (diff) |
refactor!: change errors to be more sane
BREAKING CHANGE: Major improvements have been made to error types and the error_stack crate is no longer used
Diffstat (limited to 'examples/unbound/main.rs')
-rw-r--r-- | examples/unbound/main.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/unbound/main.rs b/examples/unbound/main.rs index 3a937c3..47629e4 100644 --- a/examples/unbound/main.rs +++ b/examples/unbound/main.rs @@ -2,6 +2,9 @@ #![deny(clippy::pedantic)] #![allow(clippy::module_name_repetitions)] +use std::error::Error; + +mod animal_store; mod animals; mod bootstrap; mod interfaces; @@ -10,7 +13,7 @@ use bootstrap::bootstrap; use interfaces::dog::IDog; use interfaces::human::IHuman; -fn main() +fn main() -> Result<(), Box<dyn Error>> { println!("Hello, world!"); @@ -20,7 +23,9 @@ fn main() dog.woof(); - let human = di_container.get::<dyn IHuman>().unwrap(); + let human = di_container.get::<dyn IHuman>()?; human.make_pets_make_sounds(); + + Ok(()) } |