| 1 |
Description: Use CARGO_MANIFEST_DIR instead of trying to guess |
| 2 |
Author: Simon Quigley <[email protected]> |
| 3 |
Origin: vendor |
| 4 |
Forwarded: not-needed |
| 5 |
Last-Update: 2026-08-08 |
| 6 |
--- |
| 7 |
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ |
| 8 |
--- a/tests/testbox_tests.rs |
| 9 |
+++ b/tests/testbox_tests.rs |
| 10 |
@@ -148,20 +148,8 @@ fn main() { |
| 11 |
} |
| 12 |
} |
| 13 |
|
| 14 |
-/// Tries to find built's Cargo.toml, panics if it ends up in / |
| 15 |
fn get_built_root() -> path::PathBuf { |
| 16 |
- env::current_exe() |
| 17 |
- .map(|path| { |
| 18 |
- let mut path = path; |
| 19 |
- loop { |
| 20 |
- if path.join("Cargo.toml").exists() { |
| 21 |
- break; |
| 22 |
- } |
| 23 |
- path = path::PathBuf::from(path.parent().unwrap()); |
| 24 |
- } |
| 25 |
- path |
| 26 |
- }) |
| 27 |
- .unwrap() |
| 28 |
+ path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) |
| 29 |
} |
| 30 |
|
| 31 |
#[test] |