chore(stability): remove core feature gate

This commit is contained in:
Sean McArthur
2015-04-02 10:33:07 -07:00
parent b7d5920eb4
commit 5c2de29a81
10 changed files with 190 additions and 265 deletions

View File

@@ -1,7 +1,10 @@
use std::any::Any;
use std::any::TypeId;
use std::fmt;
use std::str::from_utf8;
use typeable::Typeable;
use super::cell::{OptCell, PtrMapCell};
use header::{Header, HeaderFormat};
@@ -24,7 +27,7 @@ impl Item {
#[inline]
pub fn new_typed(ty: Box<HeaderFormat + Send + Sync>) -> Item {
let map = PtrMapCell::new();
unsafe { map.insert((&*ty).get_type_id(), ty); }
unsafe { map.insert((*ty).get_type(), ty); }
Item {
raw: OptCell::new(None),
typed: map,
@@ -51,7 +54,7 @@ impl Item {
&raw[..]
}
pub fn typed<H: Header + HeaderFormat>(&self) -> Option<&H> {
pub fn typed<H: Header + HeaderFormat + Any>(&self) -> Option<&H> {
let tid = TypeId::of::<H>();
match self.typed.get(tid) {
Some(val) => Some(val),