crate-paths-macros

Crates.iocrate-paths-macros
lib.rscrate-paths-macros
version0.1.1
created_at2025-06-27 15:22:30.418886+00
updated_at2025-06-27 16:55:54.606555+00
description Optional macros library for crate-paths
homepage
repositoryhttps://github.com/stayhydated/crate-paths
max_upload_size
id1728834
size8,007
stayhydated (stayhydated)

documentation

README

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

cargo fmt