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

Function finite_non_negative_duration_ms

packages/server/src/main/batch.rs:802–813  ·  view source on GitHub ↗
(
    value: f64,
    multiplier: f64,
    context: &str,
)

Source from the content-addressed store, hash-verified

800}
801
802fn finite_non_negative_duration_ms(
803 value: f64,
804 multiplier: f64,
805 context: &str,
806) -> Result<u64, crate::error::AppError> {
807 if !value.is_finite() || value < 0.0 {
808 return Err(crate::error::AppError::bad_request(format!(
809 "{context} must be finite and non-negative."
810 )));
811 }
812 Ok((value * multiplier).round() as u64)
813}
814
815fn tokenize_step(line: &str) -> Result<Vec<String>, crate::error::AppError> {
816 enum State {

Callers 2

parse_duration_ms_valueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected