MCPcopy Create free account
hub / github.com/assert-rs/assert_cmd / cargo_bin_str

Function cargo_bin_str

src/cargo.rs:236–246  ·  view source on GitHub ↗
(name: &str)

Source from the content-addressed store, hash-verified

234
235#[track_caller]
236fn cargo_bin_str(name: &str) -> path::PathBuf {
237 let env_var = format!("{CARGO_BIN_EXE_}{name}");
238 match env::var_os(env_var)
239 .map(|p| p.into())
240 .or_else(|| legacy_cargo_bin(name))
241 {
242 Some(path) => path,
243 // Called manually so `#[track_caller]` is effective.
244 None => missing_cargo_bin(name),
245 }
246}
247
248const CARGO_BIN_EXE_: &str = "CARGO_BIN_EXE_";
249

Callers 1

cargo_binFunction · 0.85

Calls 2

legacy_cargo_binFunction · 0.85
missing_cargo_binFunction · 0.85

Tested by

no test coverage detected