scsys_core/utils/std.rs
1/*
2 Appellation: std_utils <module>
3 Contrib: FL03 <jo3mccain@icloud.com>
4*/
5
6/// Fetch the project root unless specified otherwise with a CARGO_MANIFEST_DIR env variable
7#[cfg(feature = "std")]
8pub fn project_root() -> std::path::PathBuf {
9 std::path::Path::new(&env!("CARGO_MANIFEST_DIR"))
10 .ancestors()
11 .nth(1)
12 .unwrap()
13 .to_path_buf()
14}