From fa368238729e95ade6ec907c9909e140d6322cf3 Mon Sep 17 00:00:00 2001 From: Kamen Mladenov Date: Wed, 16 Apr 2025 09:46:19 +0300 Subject: 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. --- zkvms_host_io/input_macros/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zkvms_host_io') 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(); -- cgit v1.2.3