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

Function is_cargo_target_binary

src/agents/mod.rs:784–800  ·  view source on GitHub ↗
(path: &Path, cargo_target_dir: Option<&Path>)

Source from the content-addressed store, hash-verified

782}
783
784fn is_cargo_target_binary(path: &Path, cargo_target_dir: Option<&Path>) -> bool {
785 if cargo_target_dir.is_some_and(|target_dir| path.starts_with(target_dir)) {
786 return true;
787 }
788
789 let mut saw_target = false;
790 for component in path.components() {
791 let value = component.as_os_str();
792 if saw_target && (value == "debug" || value == "release") {
793 return true;
794 }
795 if value == "target" {
796 saw_target = true;
797 }
798 }
799 false
800}
801
802/// Replace backslashes with forward slashes so paths work in JSON/shell
803/// contexts on Windows. No-op on Unix where paths already use `/`.

Callers 1

which_tracedecay_fromFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected