Validate walltime options for conflicting constraints
(opts: &WalltimeOptions, context: &str)
| 42 | |
| 43 | /// Validate walltime options for conflicting constraints |
| 44 | fn validate_walltime_options(opts: &WalltimeOptions, context: &str) -> Result<()> { |
| 45 | // Check for explicitly forbidden combinations |
| 46 | if opts.min_time.is_some() && opts.max_rounds.is_some() { |
| 47 | bail!( |
| 48 | "Invalid walltime configuration in {context}: cannot use both min_time and max_rounds" |
| 49 | ); |
| 50 | } |
| 51 | |
| 52 | if opts.max_time.is_some() && opts.min_rounds.is_some() { |
| 53 | bail!( |
| 54 | "Invalid walltime configuration in {context}: cannot use both max_time and min_rounds" |
| 55 | ); |
| 56 | } |
| 57 | |
| 58 | // Note: We don't parse durations here or check min < max relationships |
| 59 | // That validation happens later in WalltimeExecutionArgs::try_from(ExecutionOptions) |
| 60 | |
| 61 | Ok(()) |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | #[cfg(test)] |
nothing calls this directly
no outgoing calls
no test coverage detected