use super::ActionSpec;
impl ActionSpec {
#[must_use]
pub fn with_param_choices(
mut self,
name: &str,
choices: impl IntoIterator<Item = std::borrow::Cow<'static, str>>,
) -> Self {
let choices: Vec<std::borrow::Cow<'static, str>> = choices.into_iter().collect();
if let Some(param) = self
.type_mut()
.params
.iter_mut()
.find(|param| param.name == name)
{
param.choices = choices;
}
self
}
}