diff options
| author | Kamen Mladenov <kamen@syndamia.com> | 2025-02-03 13:36:27 +0200 |
|---|---|---|
| committer | Kamen Mladenov <kamen@syndamia.com> | 2025-02-03 13:36:27 +0200 |
| commit | 729c6075045a224724e6b2da6e57721b5d48ab12 (patch) | |
| tree | cfd4773292a349553d3a44da6f5712b1780a9493 /zkvms_host_io | |
| parent | badcb2c812b92d96925b7430effd1bee1a2c9438 (diff) | |
| download | zkVMs-benchmarks-729c6075045a224724e6b2da6e57721b5d48ab12.tar zkVMs-benchmarks-729c6075045a224724e6b2da6e57721b5d48ab12.tar.gz zkVMs-benchmarks-729c6075045a224724e6b2da6e57721b5d48ab12.zip | |
fix(zkvms_host_io): Remove useless template parameter to RunWith
Diffstat (limited to 'zkvms_host_io')
| -rw-r--r-- | zkvms_host_io/input_macros/src/lib.rs | 2 | ||||
| -rw-r--r-- | zkvms_host_io/src/lib.rs | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/zkvms_host_io/input_macros/src/lib.rs b/zkvms_host_io/input_macros/src/lib.rs index 9c15102..5e36466 100644 --- a/zkvms_host_io/input_macros/src/lib.rs +++ b/zkvms_host_io/input_macros/src/lib.rs @@ -28,7 +28,7 @@ pub fn generate_output_type_input_struct(_: TokenStream) -> TokenStream { let all_args = args_split(&args); - let mut struct_def = "#[derive(Debug, Serialize, Deserialize)] pub struct Input {".to_string(); + let mut struct_def = "#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Input {".to_string(); for arg in all_args { struct_def += &format!("pub {arg},"); } diff --git a/zkvms_host_io/src/lib.rs b/zkvms_host_io/src/lib.rs index 8e49e29..d63cb56 100644 --- a/zkvms_host_io/src/lib.rs +++ b/zkvms_host_io/src/lib.rs @@ -28,14 +28,14 @@ pub enum RunType { } #[derive(Debug, Clone, PartialEq, Eq)] -pub struct RunWith<T> { +pub struct RunWith { pub run_type: RunType, - pub input: T, + pub input: Input, pub default_env: HashMap<String, String>, } -impl<T> RunWith<T> { - pub fn env_then_or<U>(&self, variable_name: &str, then_apply: fn(String) -> Option<U>, else_const: U) -> U { +impl RunWith { + pub fn env_then_or<T>(&self, variable_name: &str, then_apply: fn(String) -> Option<T>, else_const: T) -> T { env::var(variable_name) .ok() .and_then(then_apply) @@ -53,7 +53,7 @@ impl<T> RunWith<T> { input_macros::generate_output_type_input_struct!(); -pub fn read_args() -> RunWith<Input> { +pub fn read_args() -> RunWith { let cli = Cli::parse(); let public_contents: String = if cli.public_input.is_some() { |
