crate-paths-macros 0.1.3

Optional macros library for crate-paths
Documentation

path!(...);

Usage:

path!(std::sync::Arc);

This expands to

#[allow(non_upper_case_globals)]
pub const Arc: crate_paths::Path = {
    #[allow(unused_imports)]
    use std::sync::Arc as _;

    crate_paths::Path::new("std::sync::Arc")
};

path_val!(...);

Usage:

path_val!(std::sync::Arc);

This expands to:

{
  #[allow(unused_imports)]
  use std::sync::Arc as _;

  crate_paths::Path::new("std::sync::Arc")
}

Which you would later assign to a constant:

const SOME_CONSTANT: crate_paths::Path = path_val!("std::sync::Arc");