fix cli slope name downcasting panic

This commit is contained in:
brevalferrari 2025-06-07 02:19:19 +02:00
parent 8ce0676e7d
commit 47af63c73c

View file

@ -72,7 +72,7 @@ pub(super) struct PlayOpts {
/// Add a slope expression named NAME which mutates the VARIABLE with the result of EXPR each frame
#[arg(short, long = "slope", value_name = "NAME:VARIABLE=EXPR", value_parser = parse_key_tuple::<LetterString, Letter, Expression>)]
#[getset(skip)]
slopes: Vec<(LetterString, (char, Expression))>,
slopes: Vec<(LetterString, (Letter, Expression))>,
}
impl PlayOpts {
@ -87,7 +87,7 @@ impl PlayOpts {
pub(super) fn slopes(&self) -> impl Iterator<Item = (&String, (&char, &Expression))> {
self.slopes
.iter()
.map(|(name, (v, e))| (name.as_ref(), (v, e)))
.map(|(name, (v, e))| (name.as_ref(), (v.as_ref(), e)))
}
}