(value: &SceneValue, line_no: usize)
| 509 | let norm = raw.to_ascii_lowercase().replace(['-', ' '], "_"); |
| 510 | match norm.as_str() { |
| 511 | "step" => Ok(AnimationInterpolation::Step), |
| 512 | "interpolate" | "linear" | "lerp" | "slerp" => Ok(AnimationInterpolation::Linear), |
| 513 | _ => Err(format!( |
| 514 | "line {}: unknown interpolation `{}` (expected `step` or `interpolate`)", |
| 515 | line_no, raw |
| 516 | )), |
| 517 | } |
| 518 | } |
| 519 | |
| 520 | fn parse_ease_value(value: &SceneValue, line_no: usize) -> Result<AnimationEase, String> { |
| 521 | let raw = as_text(value) |
| 522 | .ok_or_else(|| format!("line {}: ease expects text", line_no))? |
| 523 | .trim(); |
| 524 | let norm = raw.to_ascii_lowercase().replace(['-', ' '], "_"); |
| 525 | match norm.as_str() { |
| 526 | "linear" => Ok(AnimationEase::Linear), |
| 527 | "ease_in" | "easein" | "in" => Ok(AnimationEase::EaseIn), |
| 528 | "ease_out" | "easeout" | "out" => Ok(AnimationEase::EaseOut), |
| 529 | "ease_in_out" | "easeinout" | "in_out" => Ok(AnimationEase::EaseInOut), |
no test coverage detected