Chris Morgan
›
Git
›
anymap
› commitdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a2560a0
)
commit
grep
author
committer
pickaxe
?
search:
re
Elide superfluous lifetimes.
author
Chris Morgan
<me@chrismorgan.info>
Fri, 7 Nov 2014 05:26:12 +0000
committer
Chris Morgan
<me@chrismorgan.info>
Fri, 7 Nov 2014 05:26:12 +0000
src/lib.rs
patch
|
blob
|
history
diff --git
a/src/lib.rs
b/src/lib.rs
index 3e716ce5fc345a96855925e8f5c1644d4516bdb2..e7669130fd89b615c2472e07d714d9c8d3fd13a4 100644
(file)
--- 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.
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<
T: 'static>(&self) -> Option<&
T> {
self.data.find(&TypeId::of::<T>()).map(|any| unsafe { any.as_ref_unchecked::<T>() })
}
/// Retrieve a mutable reference to the value stored in the map for the type `T`, if it exists.
self.data.find(&TypeId::of::<T>()).map(|any| unsafe { any.as_ref_unchecked::<T>() })
}
/// 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<
T: 'static>(&mut self) -> Option<&
mut T> {
self.data.find_mut(&TypeId::of::<T>()).map(|any| unsafe { any.as_mut_unchecked::<T>() })
}
self.data.find_mut(&TypeId::of::<T>()).map(|any| unsafe { any.as_mut_unchecked::<T>() })
}