MCPcopy Create free account
hub / github.com/0xMiden/node / duration_to_human_readable_string

Function duration_to_human_readable_string

crates/utils/src/clap.rs:20–22  ·  view source on GitHub ↗

Formats a Duration into a human-readable string for display in clap help text and yields a &'static str by _leaking_ the string deliberately.

(duration: Duration)

Source from the content-addressed store, hash-verified

18// Formats a Duration into a human-readable string for display in clap help text and yields a
19// &'static str by _leaking_ the string deliberately.
20pub fn duration_to_human_readable_string(duration: Duration) -> &'static str {
21 Box::new(humantime::format_duration(duration).to_string()).leak()
22}
23
24#[derive(clap::Args, Copy, Clone, Debug, PartialEq, Eq)]
25pub struct GrpcOptionsInternal {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected