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

Function parse_duration_ms_value

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

Source from the content-addressed store, hash-verified

784}
785
786fn parse_duration_ms_value(value: &str, context: &str) -> Result<u64, crate::error::AppError> {
787 let duration = value
788 .trim()
789 .parse::<f64>()
790 .map_err(|_| crate::error::AppError::bad_request(format!("{context} must be numeric.")))?;
791 finite_non_negative_duration_ms(duration, 1.0, context)
792}
793
794fn parse_duration_seconds_value(value: &str, context: &str) -> Result<u64, crate::error::AppError> {
795 let duration = value

Callers 2

Calls 1

Tested by

no test coverage detected