diff --git a/.changeset/parser-lifetime-fix-and-i8-i16-support.md b/.changeset/parser-lifetime-fix-and-i8-i16-support.md new file mode 100644 index 0000000..d5edfc3 --- /dev/null +++ b/.changeset/parser-lifetime-fix-and-i8-i16-support.md @@ -0,0 +1,6 @@ +--- +"@codama/renderers-vixen-parser": patch +--- + +- Resolve build error regarding missing static lifetime on `id` method +- Expand generator support to `i8` and `i16` diff --git a/public/templates/accountsParserPage.njk b/public/templates/accountsParserPage.njk index 06913fa..9f4bafc 100644 --- a/public/templates/accountsParserPage.njk +++ b/public/templates/accountsParserPage.njk @@ -109,7 +109,7 @@ impl yellowstone_vixen_core::Parser for AccountParser { type Input = yellowstone_vixen_core::AccountUpdate; type Output = {{ programName | pascalCase }}ProgramState; - fn id(&self) -> std::borrow::Cow { + fn id(&self) -> std::borrow::Cow<'static, str> { "{{ programName | snakeCase }}::AccountParser".into() } diff --git a/public/templates/instructionsParserPage.njk b/public/templates/instructionsParserPage.njk index 9163a35..b112554 100644 --- a/public/templates/instructionsParserPage.njk +++ b/public/templates/instructionsParserPage.njk @@ -38,7 +38,7 @@ impl yellowstone_vixen_core::Parser for InstructionParser { #[cfg(feature = "shared-data")] type Output = InstructionUpdateOutput<{{ programName | pascalCase }}ProgramIx>; - fn id(&self) -> std::borrow::Cow { + fn id(&self) -> std::borrow::Cow<'static, str> { "{{ programName | pascalCase }}::InstructionParser".into() } diff --git a/src/getRenderMapVisitor.ts b/src/getRenderMapVisitor.ts index c2d35cc..1063720 100644 --- a/src/getRenderMapVisitor.ts +++ b/src/getRenderMapVisitor.ts @@ -134,6 +134,8 @@ function getNumberTypeTransform(type: NumberTypeNode) { case 'u8': case 'u16': + case 'i8': + case 'i16': return `.into()`; default: diff --git a/test/accountsParserPage.test.ts b/test/accountsParserPage.test.ts index a31a7a8..19d214f 100644 --- a/test/accountsParserPage.test.ts +++ b/test/accountsParserPage.test.ts @@ -50,7 +50,7 @@ test('it renders accounts parsers', () => { 'impl yellowstone_vixen_core::Parser for AccountParser', 'async fn parse', 'fn prefilter(&self) -> yellowstone_vixen_core::Prefilter', - 'fn id(&self) -> std::borrow::Cow', + "fn id(&self) -> std::borrow::Cow<'static, str>", 'type Input = yellowstone_vixen_core::AccountUpdate', 'type Output = TestProgramState', ]);