diff --git a/Cargo.lock b/Cargo.lock index ebd101eda..9708edc0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -24,7 +24,7 @@ dependencies = [ "icondata_im 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "icondata_io 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "icondata_lu 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", - "icondata_macros 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "icondata_macros", "icondata_oc 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "icondata_ri 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "icondata_si 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -267,13 +267,9 @@ dependencies = [ [[package]] name = "icondata_macros" -version = "0.1.2" - -[[package]] -name = "icondata_macros" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "764e3608a0f21fa9f43f9d9237c524a9e10316d97d89b413a9c45e5dddb9b162" +checksum = "ec327fa14753d8bb89a56159d617b2eee49a7d1df6575bf9e8ef524009298395" [[package]] name = "icondata_oc" diff --git a/Cargo.toml b/Cargo.toml index 8f3eb0681..210a9eff1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,5 +21,5 @@ members = [ "icondata_vs", "icondata_wi", "icondata_core", - "icondata_macros" ] +exclude = ["build", "icondata_macros"] diff --git a/build/templates/main_lib/Cargo.toml b/build/templates/main_lib/Cargo.toml index 81e52e5e8..5418c6b97 100644 --- a/build/templates/main_lib/Cargo.toml +++ b/build/templates/main_lib/Cargo.toml @@ -13,7 +13,7 @@ categories = ["web-programming"] [dependencies] icondata_core = "0.0.2" serde = { version = "1", optional = true } -icondata_macros = { version = "0.1.2", optional = true } +icondata_macros = { version = "0.1.4", optional = true } {% for (short_name, version) in sn_version -%} icondata_{{short_name}} = { version = "{{version}}", optional = true } diff --git a/icondata/Cargo.toml b/icondata/Cargo.toml index b4cdd4683..ec252518d 100644 --- a/icondata/Cargo.toml +++ b/icondata/Cargo.toml @@ -13,7 +13,7 @@ categories = ["web-programming"] [dependencies] icondata_core = "0.0.2" serde = { version = "1", optional = true } -icondata_macros = { version = "0.1.2", optional = true } +icondata_macros = { version = "0.1.4", optional = true } icondata_ai = { version = "0.0.8", optional = true } icondata_bi = { version = "0.0.8", optional = true } diff --git a/icondata_macros/Cargo.toml b/icondata_macros/Cargo.toml index 35e9c0937..8d2aa8847 100644 --- a/icondata_macros/Cargo.toml +++ b/icondata_macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icondata_macros" -version = "0.1.2" +version = "0.1.4" edition = "2021" authors = ["Charles Edward Gagnon"] license = "MIT" @@ -13,3 +13,6 @@ keywords = ["icons", "svg", "macro"] [lib] proc-macro = true + +[dev-dependencies] +icondata = { path = "../icondata", features = ["AiFileImageTwotone", "macros"] } diff --git a/icondata_macros/src/lib.rs b/icondata_macros/src/lib.rs index f52244ad2..b78605e95 100644 --- a/icondata_macros/src/lib.rs +++ b/icondata_macros/src/lib.rs @@ -7,9 +7,13 @@ extern crate proc_macro; /// /// ### Example /// ``` +/// use icondata::{icon, Icon}; +/// +/// /// let icon: Icon = icon!(AiFileImageTwotone); +/// assert_eq!(icon, Icon::from(icondata::AiFileImageTwotone)); /// // Instead of: -/// let icon: Icon = Icon::from(AiIcon::AiFileImageTwotone); +/// // let icon: Icon = Icon::from(AiIcon::AiFileImageTwotone); /// ``` #[proc_macro] pub fn icon(input: proc_macro::TokenStream) -> proc_macro::TokenStream { @@ -31,8 +35,8 @@ pub fn icon(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let (lib_short_name, icon_name) = icon_string.split_at(2); format!( - "Icon::from({}Icon::{}{})", - lib_short_name, lib_short_name, icon_name + "icondata::Icon::from(icondata::{}{})", + lib_short_name, icon_name ) .parse() .unwrap()