simplify service trait bounds and lifetimes

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk authored and strawberry committed 2024-10-25 00:15:01 -04:00
1 parent 16014e1594
commit 2db017af37
2 files changed
+13 -18

No files matched your search

+4 -4
View File
@@ -193,16 +193,16 @@ impl Services {
}
}
pub fn try_get<'a, 'b, T>(&'b self, name: &'a str) -> Result<Arc<T>>
pub fn try_get<T>(&self, name: &str) -> Result<Arc<T>>
where
T: Send + Sync + 'a + 'b + 'static,
T: Any + Send + Sync + Sized,
{
service::try_get::<T>(&self.service, name)
}
pub fn get<'a, 'b, T>(&'b self, name: &'a str) -> Option<Arc<T>>
pub fn get<T>(&self, name: &str) -> Option<Arc<T>>
where
T: Send + Sync + 'a + 'b + 'static,
T: Any + Send + Sync + Sized,
{
service::get::<T>(&self.service, name)
}