MCPcopy Create free account
hub / github.com/ccusage/ccusage / parse_token_limit

Function parse_token_limit

rust/crates/ccusage/src/blocks.rs:571–576  ·  view source on GitHub ↗
(value: Option<&str>, max_tokens: u64)

Source from the content-addressed store, hash-verified

569}
570
571fn parse_token_limit(value: Option<&str>, max_tokens: u64) -> Option<u64> {
572 match value {
573 None | Some("") | Some("max") => (max_tokens > 0).then_some(max_tokens),
574 Some(value) => value.parse().ok(),
575 }
576}
577
578pub(crate) fn format_remaining_time(minutes: i64) -> String {
579 let hours = minutes / 60;

Callers 3

block_jsonFunction · 0.85
print_blocks_tableFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected