From d872f7cf8a285305929aeaa2a653685c10f6d6f3 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 15 Sep 2021 21:13:03 +0200 Subject: [PATCH] Limit NestedValue self-parse/unparse support to () rather than L --- implementations/rust/preserves-schema/src/support/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/implementations/rust/preserves-schema/src/support/mod.rs b/implementations/rust/preserves-schema/src/support/mod.rs index 8e40a84..8337ad4 100644 --- a/implementations/rust/preserves-schema/src/support/mod.rs +++ b/implementations/rust/preserves-schema/src/support/mod.rs @@ -23,8 +23,8 @@ pub trait Parse: Sized { fn parse<'a, LL: Into<&'a L>>(language: LL, value: &Value) -> Result where L: 'a; } -impl Parse for Value { - fn parse<'a, LL: Into<&'a L>>(_language: LL, value: &Value) -> Result where L: 'a { +impl Parse<(), Value> for Value { + fn parse<'a, LL: Into<&'a ()>>(_language: LL, value: &Value) -> Result { Ok(value.clone()) } } @@ -33,8 +33,8 @@ pub trait Unparse { fn unparse<'a, LL: Into<&'a L>>(&self, language: LL) -> Value where L: 'a; } -impl Unparse for Value { - fn unparse<'a, LL: Into<&'a L>>(&self, _language: LL) -> Value where L: 'a { +impl Unparse<(), Value> for Value { + fn unparse<'a, LL: Into<&'a ()>>(&self, _language: LL) -> Value { self.clone() } }