location-macros

Crates.iolocation-macros
lib.rslocation-macros
version0.1.2
sourcesrc
created_at2023-03-21 17:03:04.440018
updated_at2023-03-21 17:10:46.401115
descriptionCollection of macros for obtaining the absolute path of the project root
homepage
repositoryhttps://github.com/takagiy/location-macros
max_upload_size
id816356
size8,139
Yuki Takagi (takagiy)

documentation

README

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);
    
Commit count: 11

cargo fmt