MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / dir_is_missing_or_empty

Function dir_is_missing_or_empty

src/diagnostics/mod.rs:118–123  ·  view source on GitHub ↗

True when `path` does not exist, is not a directory, or contains no entries. Any read error is treated as "cold" so we err toward prewarming rather than blocking.

(path: &Path)

Source from the content-addressed store, hash-verified

116/// entries. Any read error is treated as "cold" so we err toward prewarming
117/// rather than blocking.
118fn dir_is_missing_or_empty(path: &Path) -> bool {
119 match std::fs::read_dir(path) {
120 Ok(mut entries) => entries.next().is_none(),
121 Err(_) => true,
122 }
123}
124
125/// Path to the private Rust diagnostics cargo target dir. Exposed so callers
126/// can surface it in prewarm status messages.

Callers 1

is_rust_diagnostics_coldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected