(path: &Path, cargo_target_dir: Option<&Path>)
| 782 | } |
| 783 | |
| 784 | fn 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 `/`. |
no outgoing calls
no test coverage detected