Value self-parsing happens with &() now, not ()

This commit is contained in:
Tony Garnock-Jones 2021-09-17 11:37:36 +02:00
parent 15a27b4865
commit e78196c942
1 changed files with 4 additions and 4 deletions

View File

@ -23,8 +23,8 @@ pub trait Parse<L, Value: NestedValue>: Sized {
fn parse(language: L, value: &Value) -> Result<Self, ParseError>;
}
impl<Value: NestedValue> Parse<(), Value> for Value {
fn parse(_language: (), value: &Value) -> Result<Self, ParseError> {
impl<'a, Value: NestedValue> Parse<&'a (), Value> for Value {
fn parse(_language: &'a (), value: &Value) -> Result<Self, ParseError> {
Ok(value.clone())
}
}
@ -33,8 +33,8 @@ pub trait Unparse<L, Value: NestedValue> {
fn unparse(&self, language: L) -> Value;
}
impl<Value: NestedValue> Unparse<(), Value> for Value {
fn unparse(&self, _language: ()) -> Value {
impl<'a, Value: NestedValue> Unparse<&'a (), Value> for Value {
fn unparse(&self, _language: &'a ()) -> Value {
self.clone()
}
}