diff --git a/implementations/rust/preserves-schema/src/compiler/parsers.rs b/implementations/rust/preserves-schema/src/compiler/parsers.rs index e604bad..b57fbee 100644 --- a/implementations/rust/preserves-schema/src/compiler/parsers.rs +++ b/implementations/rust/preserves-schema/src/compiler/parsers.rs @@ -73,7 +73,7 @@ pub fn gen_definition_parser(m: &mut ModuleContext, n: &str, d: &Definition) { " _support::Parse", anglebrackets![ctxt.m.any_type()], " for ", names::render_constructor(n), ty.generic_arg(ctxt.m), " ", codeblock![ - "type Language = crate::gen::Language<_Value>;", + seq!["type Language = ", ctxt.m.language_type(), ";"], seq!["fn parse<'a, _LL: Into<&'a Self::Language>>", "(_ctxt: _LL, value: &", ctxt.m.any_type(), ") ", " -> std::result::Result", diff --git a/implementations/rust/preserves-schema/src/compiler/unparsers.rs b/implementations/rust/preserves-schema/src/compiler/unparsers.rs index e35201f..02c1deb 100644 --- a/implementations/rust/preserves-schema/src/compiler/unparsers.rs +++ b/implementations/rust/preserves-schema/src/compiler/unparsers.rs @@ -101,7 +101,7 @@ pub fn gen_definition_unparser(m: &mut ModuleContext, n: &str, d: &Definition) { " _support::Unparse", anglebrackets![ctxt.m.any_type()], " for ", names::render_constructor(n), ty.generic_arg(ctxt.m), " ", codeblock![ - "type Language = crate::gen::Language<_Value>;", + seq!["type Language = ", ctxt.m.language_type(), ";"], seq!["fn unparse<'a, _LL: Into<&'a Self::Language>>", "(&self, _ctxt: _LL) -> ", ctxt.m.any_type(), " where ", ctxt.m.language_type(), ": 'a ",