Skip to content

Commit

Permalink
fix for bindings for imported optional Rust Map type
Browse files Browse the repository at this point in the history
  • Loading branch information
krisbitney committed Aug 21, 2022
1 parent c6d1d0b commit 8689d5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/schema/bind/src/bindings/rust/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const toWasmInit: MustacheFunction = () => {
.substring(openBracketIdx + 1, closeBracketIdx)
.split(",")
.map((x) => toWasm()(x.trim(), render));
return `Map::<${key}, ${value}>::new()`;
return optionalModifier(`Map::<${key}, ${value}>::new()`);
}

switch (type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub fn read_{{#toLower}}{{type}}{{/toLower}}<R: Read>(reader: &mut R) -> Result<
{{/array}}
{{#map}}
_{{#toLower}}{{name}}{{/toLower}} = reader.read_{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}(|reader| {
reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}()?
reader.read_{{#key}}{{#toLower}}{{#toMsgPack}}{{toGraphQLType}}{{/toMsgPack}}{{/toLower}}{{/key}}()
}, |reader| {
{{#value}}
{{> deserialize_map_value_nobox}}
Expand Down

0 comments on commit 8689d5c

Please sign in to comment.