From 0b4232d343e2214ead8fa62583bff2e948173ddf Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 20 Aug 2023 17:01:12 +0200 Subject: feat: expose DI container get_bound methods to public API --- src/errors/di_container.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/errors') diff --git a/src/errors/di_container.rs b/src/errors/di_container.rs index 311917a..7e29ffa 100644 --- a/src/errors/di_container.rs +++ b/src/errors/di_container.rs @@ -38,7 +38,7 @@ pub enum DIContainerError /// No binding exists for a interface (and optionally a name). #[error( "No binding exists for interface '{interface}' {}", - .name.map_or_else(String::new, |name| format!("with name '{name}'")) + name.as_ref().map(|name| format!("with name '{name}'")).unwrap_or_default() )] BindingNotFound { @@ -46,7 +46,7 @@ pub enum DIContainerError interface: &'static str, /// The name of the binding if one exists. - name: Option<&'static str>, + name: Option, }, } -- cgit v1.2.3-18-g5258