forked from syndicate-lang/preserves
Limit NestedValue self-parse/unparse support to () rather than L
This commit is contained in:
parent
7bf5403353
commit
d872f7cf8a
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue