Crates.io | location-macros |
lib.rs | location-macros |
version | 0.1.2 |
source | src |
created_at | 2023-03-21 17:03:04.440018 |
updated_at | 2023-03-21 17:10:46.401115 |
description | Collection of macros for obtaining the absolute path of the project root |
homepage | |
repository | https://github.com/takagiy/location-macros |
max_upload_size | |
id | 816356 |
size | 8,139 |
Get the root directory of the current crate.
use location_macros::crate_dir;
let crate_dir = crate_dir!();
println!("The current crate root is {}", crate_dir);
Get the root directory of the workspace containing current crate.
use location_macros::workspace_dir;
let workspace_dir = workspace_dir!();
println!("The current workspace root is {}", workspace_dir);