MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / is_daily_file

Function is_daily_file

atomic-cli/src/logging/retention.rs:41–51  ·  view source on GitHub ↗
(path: &Path, prefix: &str, suffix: &str)

Source from the content-addressed store, hash-verified

39}
40
41fn is_daily_file(path: &Path, prefix: &str, suffix: &str) -> bool {
42 let Some(name) = path.file_name().and_then(|name| name.to_str()) else {
43 return false;
44 };
45 let date = name
46 .strip_prefix(prefix)
47 .and_then(|rest| rest.strip_prefix('.'))
48 .and_then(|rest| rest.strip_suffix(suffix))
49 .and_then(|rest| rest.strip_suffix('.'));
50 date.is_some_and(is_iso_date)
51}
52
53fn is_iso_date(text: &str) -> bool {
54 text.len() == 10

Callers 1

pruneFunction · 0.85

Calls 1

file_nameMethod · 0.45

Tested by

no test coverage detected