Skip to content

Commit 8dc7092

Browse files
authored
Fix missing semicolon in generated Rust code (#238)
1 parent 5301068 commit 8dc7092

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.changeset/many-rules-peel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@codama/renderers-rust': patch
3+
---
4+
5+
Fix missing semicolon in generated Rust code

packages/renderers-rust/src/getTypeManifestVisitor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export function getTypeManifestVisitor(options: {
163163
return {
164164
...manifest,
165165
nestedStructs,
166-
type: `pub type ${pascalCase(definedType.name)} = ${manifest.type}`,
166+
type: `pub type ${pascalCase(definedType.name)} = ${manifest.type};`,
167167
};
168168
}
169169

packages/renderers-rust/test/types/array.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test('it exports short vecs', () => {
2525

2626
// Then we expect a short vec to be exported.
2727
codeContains(renderMap.get('types/my_short_vec.rs'), [
28-
/pub type MyShortVec = ShortVec<Pubkey>/,
28+
/pub type MyShortVec = ShortVec<Pubkey>;/,
2929
/use solana_program::pubkey::Pubkey/,
3030
/use solana_program::short_vec::ShortVec/,
3131
]);
@@ -52,7 +52,7 @@ test('it exports short vecs as struct fields', () => {
5252

5353
// Then we expect a short vec to be exported as a struct field.
5454
codeContains(renderMap.get('types/my_short_vec.rs'), [
55-
/pub value: ShortVec<Pubkey>/,
55+
/pub value: ShortVec<Pubkey>,/,
5656
/use solana_program::pubkey::Pubkey/,
5757
/use solana_program::short_vec::ShortVec/,
5858
]);

0 commit comments

Comments
 (0)