aboutsummaryrefslogtreecommitdiff
path: root/src/di_container_binding_map.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/di_container_binding_map.rs')
-rw-r--r--src/di_container_binding_map.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/di_container_binding_map.rs b/src/di_container_binding_map.rs
index 4aa246e..eb71ff7 100644
--- a/src/di_container_binding_map.rs
+++ b/src/di_container_binding_map.rs
@@ -27,18 +27,17 @@ where
}
}
- pub fn get<Interface>(&self, name: Option<&'static str>) -> Option<&Provider>
+ #[allow(clippy::borrowed_box)]
+ pub fn get<Interface>(&self, name: Option<&'static str>) -> Option<&Box<Provider>>
where
Interface: 'static + ?Sized,
{
let interface_typeid = TypeId::of::<Interface>();
- self.bindings
- .get(&DIContainerBindingKey {
- type_id: interface_typeid,
- name,
- })
- .map(|provider| provider.as_ref())
+ self.bindings.get(&DIContainerBindingKey {
+ type_id: interface_typeid,
+ name,
+ })
}
pub fn set<Interface>(&mut self, name: Option<&'static str>, provider: Box<Provider>)