Limit NestedValue self-parse/unparse support to () rather than L

This commit is contained in:
Tony Garnock-Jones 2021-09-15 21:13:03 +02:00
parent 7bf5403353
commit d872f7cf8a
1 changed files with 4 additions and 4 deletions

View File

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