Skip to content

Commit 7b1c73c

Browse files
committed
Bump to 0.7.2
1 parent 1084b91 commit 7b1c73c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "conduit"
4-
version = "0.7.1"
4+
version = "0.7.2"
55
authors = ["[email protected]",
66
"Alex Crichton <[email protected]>"]
77
description = "Common HTTP server interface"

src/typemap.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,35 @@ use std::boxed::BoxAny;
33
use std::collections::HashMap;
44

55
pub struct TypeMap {
6-
data: HashMap<TypeId, Box<Any + 'static>>
6+
data: HashMap<TypeId, Box<Any>>
77
}
88

99
impl TypeMap {
1010
pub fn new() -> TypeMap {
1111
TypeMap { data: HashMap::new() }
1212
}
1313

14-
pub fn find<T: 'static>(&self) -> Option<&T> {
14+
pub fn find<T: Any>(&self) -> Option<&T> {
1515
self.data.get(&TypeId::of::<T>()).and_then(|a| a.downcast_ref())
1616
}
1717

18-
pub fn find_mut<T: 'static>(&mut self) -> Option<&mut T> {
18+
pub fn find_mut<T: Any>(&mut self) -> Option<&mut T> {
1919
self.data.get_mut(&TypeId::of::<T>()).and_then(|a| a.downcast_mut())
2020
}
2121

22-
pub fn insert<T: 'static>(&mut self, val: T) -> bool {
22+
pub fn insert<T: Any>(&mut self, val: T) -> bool {
2323
self.data.insert(TypeId::of::<T>(), Box::new(val) as Box<Any>).is_none()
2424
}
2525

26-
pub fn remove<T: 'static>(&mut self) -> bool {
26+
pub fn remove<T: Any>(&mut self) -> bool {
2727
self.data.remove(&TypeId::of::<T>()).is_some()
2828
}
2929

30-
pub fn contains<T: 'static>(&self) -> bool {
30+
pub fn contains<T: Any>(&self) -> bool {
3131
self.data.contains_key(&TypeId::of::<T>())
3232
}
3333

34-
pub fn pop<T: 'static>(&mut self) -> Option<T> {
34+
pub fn pop<T: Any>(&mut self) -> Option<T> {
3535
let data = match self.data.remove(&TypeId::of::<T>()) {
3636
Some(data) => data,
3737
None => return None,

0 commit comments

Comments
 (0)