MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse_hour

Function parse_hour

nodedb/src/control/security/conditional.rs:251–256  ·  view source on GitHub ↗

Parse "HH:MM" to hour.

(s: &str)

Source from the content-addressed store, hash-verified

249
250/// Parse "HH:MM" to hour.
251fn parse_hour(s: &str) -> u8 {
252 s.split(':')
253 .next()
254 .and_then(|h| h.parse::<u8>().ok())
255 .unwrap_or(0)
256}
257
258#[cfg(test)]
259mod tests {

Callers 1

parse_conditionsFunction · 0.85

Calls 2

nextMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected