MCPcopy Index your code
hub / github.com/assert-rs/assert_cmd / cargo_bin_cmd

Function cargo_bin_cmd

src/cargo.rs:155–168  ·  view source on GitHub ↗
(name: S)

Source from the content-addressed store, hash-verified

153}
154
155pub(crate) fn cargo_bin_cmd<S: AsRef<str>>(name: S) -> Result<process::Command, CargoError> {
156 let path = cargo_bin(name);
157 if path.is_file() {
158 if let Some(runner) = cargo_runner() {
159 let mut cmd = process::Command::new(&runner[0]);
160 cmd.args(&runner[1..]).arg(path);
161 Ok(cmd)
162 } else {
163 Ok(process::Command::new(path))
164 }
165 } else {
166 Err(CargoError::with_cause(NotFoundError { path }))
167 }
168}
169
170pub(crate) fn cargo_runner() -> Option<Vec<String>> {
171 let runner_env = format!(

Callers 2

cargo_binMethod · 0.85
cargo_binMethod · 0.85

Calls 4

cargo_binFunction · 0.85
cargo_runnerFunction · 0.85
argMethod · 0.80
argsMethod · 0.80

Tested by

no test coverage detected