workspace_dir!() { /* proc-macro */ }
Expand description

Expands to a string literal that contains the absolute path of the root directory of the current workspace.

If the current crate is not in a workspace, this expands as same as crate_dir!.

Examples

use location_macros::workspace_dir;

let workspace_dir = workspace_dir!();
println!("The current workspace root is {}", workspace_dir);