From: Chris Morgan Date: Fri, 7 Nov 2014 05:26:12 +0000 (+1100) Subject: Elide superfluous lifetimes. X-Git-Tag: 0.9.1~8 X-Git-Url: https://git.chrismorgan.info/anymap/commitdiff_plain/b836d28a1353150763cf87586a112883be6e0443 Elide superfluous lifetimes. --- 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::() }) }