Description: Use CARGO_MANIFEST_DIR instead of trying to guess Author: Simon Quigley Origin: vendor Forwarded: not-needed Last-Update: 2026-08-08 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/tests/testbox_tests.rs +++ b/tests/testbox_tests.rs @@ -148,20 +148,8 @@ fn main() { } } -/// Tries to find built's Cargo.toml, panics if it ends up in / fn get_built_root() -> path::PathBuf { - env::current_exe() - .map(|path| { - let mut path = path; - loop { - if path.join("Cargo.toml").exists() { - break; - } - path = path::PathBuf::from(path.parent().unwrap()); - } - path - }) - .unwrap() + path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) } #[test]