This commit is contained in:
Tony Garnock-Jones 2021-09-16 16:35:12 +02:00
parent 8d587c0aaa
commit df4059ee7a
2 changed files with 2 additions and 2 deletions

View File

@ -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<Self, _support::ParseError>",

View File

@ -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 ",