forked from syndicate-lang/preserves
Value self-parsing happens with &() now, not ()
This commit is contained in:
parent
15a27b4865
commit
e78196c942
|
@ -23,8 +23,8 @@ pub trait Parse<L, Value: NestedValue>: Sized {
|
||||||
fn parse(language: L, value: &Value) -> Result<Self, ParseError>;
|
fn parse(language: L, value: &Value) -> Result<Self, ParseError>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Value: NestedValue> Parse<(), Value> for Value {
|
impl<'a, Value: NestedValue> Parse<&'a (), Value> for Value {
|
||||||
fn parse(_language: (), value: &Value) -> Result<Self, ParseError> {
|
fn parse(_language: &'a (), value: &Value) -> Result<Self, ParseError> {
|
||||||
Ok(value.clone())
|
Ok(value.clone())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,8 @@ pub trait Unparse<L, Value: NestedValue> {
|
||||||
fn unparse(&self, language: L) -> Value;
|
fn unparse(&self, language: L) -> Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Value: NestedValue> Unparse<(), Value> for Value {
|
impl<'a, Value: NestedValue> Unparse<&'a (), Value> for Value {
|
||||||
fn unparse(&self, _language: ()) -> Value {
|
fn unparse(&self, _language: &'a ()) -> Value {
|
||||||
self.clone()
|
self.clone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue