mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-16 23:42:27 +00:00
Reuse XFL wire scalar parsers
This commit is contained in:
1 parent
e4325a82d0
commit
afad374d74
1 file changed
+1
-9
@@ -4,7 +4,7 @@
|
||||
//! library items and mapping effects/envelopes into a consumer's audio model remain application
|
||||
//! responsibilities.
|
||||
|
||||
use crate::shape::XflElement;
|
||||
use crate::shape::{XflElement, integer, number};
|
||||
|
||||
/// Native frame-sound synchronization mode. Unknown values use Animate's event behavior.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||
@@ -97,14 +97,6 @@ impl<E: XflElement> EnvelopePoint<'_, E> {
|
||||
}
|
||||
}
|
||||
|
||||
fn number(element: &impl XflElement, name: &str) -> Option<f32> {
|
||||
element.attr(name)?.trim().parse::<f32>().ok().filter(|value| value.is_finite())
|
||||
}
|
||||
|
||||
fn integer(element: &impl XflElement, name: &str) -> Option<u32> {
|
||||
element.attr(name)?.trim().parse::<u32>().ok()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in new issue
Block a user