diff options
fix(zkvms_host_io/input_macros): Add comma on public_types count
The `sep` variable is used below, in `output_type`, where the public
types are laid out. Before, we checked the count of all types, including
private ones, which caused a crash when we have no private inputs.
1 files changed, 1 insertions, 1 deletions
| -rw-r--r-- | zkvms_host_io/input_macros/src/lib.rs | 2 |
diff --git a/zkvms_host_io/input_macros/src/lib.rs b/zkvms_host_io/input_macros/src/lib.rs index e66a0a4..448f76e 100644 --- a/zkvms_host_io/input_macros/src/lib.rs +++ b/zkvms_host_io/input_macros/src/lib.rs @@ -66,7 +66,7 @@ static DERIVES: &str = "#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deseria pub fn generate_output_type_input_struct(_: TokenStream) -> TokenStream { let fd = new_fd(); - let sep = if fd.types().is_empty() { "" } else { ", " }; + let sep = if fd.public_types().is_empty() { "" } else { ", " }; let output_type = format!("pub type Output = ({} {} {});", fd.grouped_public_types(), sep, fd.return_type).to_string(); let return_type = format!("pub type Return = {};", fd.return_type).to_string(); |
