#macro #root-path #project

macro location-macros

Collection of macros for obtaining the absolute path of the project root

3 releases

0.1.2 Mar 21, 2023
0.1.1 Mar 21, 2023
0.1.0 Mar 21, 2023

#8 in #root-path

Download history 95/week @ 2025-07-02 169/week @ 2025-07-09 148/week @ 2025-07-16 92/week @ 2025-07-23 105/week @ 2025-07-30 44/week @ 2025-08-06 37/week @ 2025-08-13 62/week @ 2025-08-20 72/week @ 2025-08-27 57/week @ 2025-09-03 46/week @ 2025-09-10 363/week @ 2025-09-17 122/week @ 2025-09-24 310/week @ 2025-10-01 323/week @ 2025-10-08 549/week @ 2025-10-15

1,353 downloads per month
Used in 3 crates

BSL-1.0 license

7KB
109 lines

location-macros

A collection of macros for obtaining the absolute path of the project root.


location-macros - A collection of macros for obtaining the absolute path of the project root

Examples

  • 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);
    

Dependencies

~185–610KB
~14K SLoC