MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / parse_duration_seconds_value

Function parse_duration_seconds_value

packages/server/src/main/batch.rs:794–800  ·  view source on GitHub ↗
(value: &str, context: &str)

Source from the content-addressed store, hash-verified

792}
793
794fn parse_duration_seconds_value(value: &str, context: &str) -> Result<u64, crate::error::AppError> {
795 let duration = value
796 .trim()
797 .parse::<f64>()
798 .map_err(|_| crate::error::AppError::bad_request(format!("{context} must be numeric.")))?;
799 finite_non_negative_duration_ms(duration, 1000.0, context)
800}
801
802fn finite_non_negative_duration_ms(
803 value: f64,

Callers 2

Calls 1

Tested by

no test coverage detected