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

Function is_rust_diagnostics_cold

src/diagnostics/mod.rs:107–113  ·  view source on GitHub ↗

Whether the Rust diagnostics build is "cold" — i.e. the private cargo target dir does not exist yet or is effectively empty. The first `cargo check` against a cold tree builds every dependency from scratch and can block for minutes on a large workspace; the MCP layer uses this to offer a non-blocking prewarm instead of freezing the agent. Returns `false` for projects without a `Cargo.toml` (nothi

(project_root: &Path)

Source from the content-addressed store, hash-verified

105/// Returns `false` for projects without a `Cargo.toml` (nothing to warm) and
106/// once the target dir has any build artifacts (subsequent checks are fast).
107pub fn is_rust_diagnostics_cold(project_root: &Path) -> bool {
108 if !project_root.join("Cargo.toml").exists() {
109 return false;
110 }
111 let target_dir = rust::target_dir_for(project_root);
112 dir_is_missing_or_empty(&target_dir)
113}
114
115/// True when `path` does not exist, is not a directory, or contains no
116/// entries. Any read error is treated as "cold" so we err toward prewarming

Callers 1

handle_diagnosticsFunction · 0.85

Calls 3

target_dir_forFunction · 0.85
dir_is_missing_or_emptyFunction · 0.85
existsMethod · 0.80

Tested by

no test coverage detected