X-Git-Url: https://git.chrismorgan.info/anymap/blobdiff_plain/a2560a090f4913796b74b5d85f8caa671fc40274..63e4c18ed7748325476eaed3a11e1496b9bcc932:/src/lib.rs diff --git a/src/lib.rs b/src/lib.rs index 3e716ce..e766913 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -122,12 +122,12 @@ impl AnyMap { impl AnyMap { /// Retrieve the value stored in the map for the type `T`, if it exists. - pub fn find<'a, T: 'static>(&'a self) -> Option<&'a T> { + pub fn find(&self) -> Option<&T> { self.data.find(&TypeId::of::()).map(|any| unsafe { any.as_ref_unchecked::() }) } /// Retrieve a mutable reference to the value stored in the map for the type `T`, if it exists. - pub fn find_mut<'a, T: 'static>(&'a mut self) -> Option<&'a mut T> { + pub fn find_mut(&mut self) -> Option<&mut T> { self.data.find_mut(&TypeId::of::()).map(|any| unsafe { any.as_mut_unchecked::() }) }