Remove use of specialization

This commit is contained in:
est31 2019-09-03 02:13:41 +02:00
parent 225ef8e75d
commit 35d576f540
2 changed files with 0 additions and 11 deletions

View File

@ -1,5 +1,4 @@
#![feature(generators)] #![feature(generators)]
#![feature(specialization)]
#![feature(proc_macro_hygiene)] #![feature(proc_macro_hygiene)]
#[macro_use] #[macro_use]

View File

@ -5,16 +5,6 @@ pub trait ExtractType: Sized {
fn extract(value: &Tagged<Value>) -> Result<Self, ShellError>; fn extract(value: &Tagged<Value>) -> Result<Self, ShellError>;
} }
impl<T> ExtractType for T {
default fn extract(_value: &Tagged<Value>) -> Result<T, ShellError> {
let name = std::any::type_name::<T>();
Err(ShellError::unimplemented(format!(
"<T> ExtractType for {}",
name
)))
}
}
impl<T: ExtractType> ExtractType for Tagged<T> { impl<T: ExtractType> ExtractType for Tagged<T> {
fn extract(value: &Tagged<Value>) -> Result<Tagged<T>, ShellError> { fn extract(value: &Tagged<Value>) -> Result<Tagged<T>, ShellError> {
let name = std::any::type_name::<T>(); let name = std::any::type_name::<T>();