aboutsummaryrefslogtreecommitdiff
path: root/zkvms_host_io
diff options
context:
space:
mode:
authorKamen Mladenov <kamen@syndamia.com>2025-04-16 09:46:19 +0300
committerKamen Mladenov <kamen@syndamia.com>2025-04-23 17:28:22 +0300
commitfa368238729e95ade6ec907c9909e140d6322cf3 (patch)
tree840c54fd4d656c336c4f7059dc006d839bf615c4 /zkvms_host_io
parent0c54fb0540591ab5ddcb4de2a2ff7fc54bd3b798 (diff)
downloadzkVMs-benchmarks-fa368238729e95ade6ec907c9909e140d6322cf3.tar
zkVMs-benchmarks-fa368238729e95ade6ec907c9909e140d6322cf3.tar.gz
zkVMs-benchmarks-fa368238729e95ade6ec907c9909e140d6322cf3.zip
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.
Diffstat (limited to 'zkvms_host_io')
-rw-r--r--zkvms_host_io/input_macros/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
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();