#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 485/week @ 2025-10-13 368/week @ 2025-10-20 237/week @ 2025-10-27 72/week @ 2025-11-03 51/week @ 2025-11-10 182/week @ 2025-11-17 24/week @ 2025-11-24 66/week @ 2025-12-01 45/week @ 2025-12-08 47/week @ 2025-12-15 41/week @ 2025-12-22 23/week @ 2025-12-29 44/week @ 2026-01-05 19/week @ 2026-01-12 38/week @ 2026-01-19 22/week @ 2026-01-26

126 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

~150–550KB
~13K SLoC