mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 16:33:37 +01:00
Remove use of specialization
This commit is contained in:
parent
225ef8e75d
commit
35d576f540
@ -1,5 +1,4 @@
|
|||||||
#![feature(generators)]
|
#![feature(generators)]
|
||||||
#![feature(specialization)]
|
|
||||||
#![feature(proc_macro_hygiene)]
|
#![feature(proc_macro_hygiene)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
@ -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>();
|
||||||
|
Loading…
Reference in New Issue
Block a user