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

Function sort_summaries

rust/crates/ccusage/src/summary.rs:287–295  ·  view source on GitHub ↗
(rows: &mut [UsageSummary], order: &SortOrder, date_fn: F)

Source from the content-addressed store, hash-verified

285}
286
287pub(crate) fn sort_summaries<F>(rows: &mut [UsageSummary], order: &SortOrder, date_fn: F)
288where
289 F: Fn(&UsageSummary) -> &str,
290{
291 rows.sort_by(|a, b| match order {
292 SortOrder::Asc => date_fn(a).cmp(date_fn(b)),
293 SortOrder::Desc => date_fn(b).cmp(date_fn(a)),
294 });
295}
296
297pub(crate) fn week_start(date: &str, start: WeekDay) -> Option<String> {
298 let date = parse_iso_date(date)?;

Callers 15

run_bucketFunction · 0.85
run_weeklyFunction · 0.85
runFunction · 0.85
runFunction · 0.85
runFunction · 0.85
runFunction · 0.85
runFunction · 0.85
report_jsonFunction · 0.85
runFunction · 0.85
runFunction · 0.85
runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected