From e42ad860453d4dad0509847221b75170ff681cfa Mon Sep 17 00:00:00 2001 From: Charles Edward Gagnon Date: Fri, 2 Aug 2024 08:39:39 -0400 Subject: [PATCH] renamed short_name to feature_name --- build/src/fs/cargo_toml.rs | 6 +++--- build/src/fs/lib_rs.rs | 6 +++--- build/templates/main_lib/Cargo.toml | 8 ++++---- build/templates/main_lib/lib.rs | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build/src/fs/cargo_toml.rs b/build/src/fs/cargo_toml.rs index b9b034192..ae91c48c9 100644 --- a/build/src/fs/cargo_toml.rs +++ b/build/src/fs/cargo_toml.rs @@ -36,7 +36,7 @@ impl CargoToml { #[template(path = "main_lib/Cargo.toml", escape = "none")] struct Template<'a> { short_name_version: Vec<(&'a str, String)>, - short_name_full_name: Vec<(&'a str, String)>, + short_name_feature_name: Vec<(&'a str, String)>, } let short_name_version: Vec<_> = crate::Packages::get()? @@ -49,12 +49,12 @@ impl CargoToml { }) .collect(); - let short_name_full_name: Vec<_> = crate::Packages::get()? + let short_name_feature_name: Vec<_> = crate::Packages::get()? .iter() .map(|package| (&*package.meta.short_name, package.meta.package_name.to_kebab_case())) .collect(); - Ok(Template { short_name_version, short_name_full_name }.render()?) + Ok(Template { short_name_version, short_name_feature_name }.render()?) } LibType::IconIndex => unimplemented!("IconIndex does not generate a Cargo.toml file."), diff --git a/build/src/fs/lib_rs.rs b/build/src/fs/lib_rs.rs index 9f339b7a3..6258930ba 100644 --- a/build/src/fs/lib_rs.rs +++ b/build/src/fs/lib_rs.rs @@ -44,15 +44,15 @@ impl LibRs { #[derive(Template)] #[template(path = "main_lib/lib.rs", escape = "none")] struct Template<'a> { - short_name_full_name: Vec<(&'a str, String)>, + short_name_feature_name: Vec<(&'a str, String)>, } - let short_name_full_name = Packages::get()? + let short_name_feature_name = Packages::get()? .iter() .map(|package| (package.meta.short_name.as_ref(), package.meta.package_name.to_kebab_case())) .collect::>(); - Ok(Template { short_name_full_name }.render()?) + Ok(Template { short_name_feature_name }.render()?) } LibType::IconIndex => { #[derive(Template)] diff --git a/build/templates/main_lib/Cargo.toml b/build/templates/main_lib/Cargo.toml index 7e7284933..533c0d714 100644 --- a/build/templates/main_lib/Cargo.toml +++ b/build/templates/main_lib/Cargo.toml @@ -22,11 +22,11 @@ icondata_{{short_name}} = { path = "../icondata_{{short_name}}", version = "{{ve serde = ["icondata_core/serde"] default = [ - {% for (_, full_name) in short_name_full_name -%} - "{{full_name}}", + {% for (_, feature_name) in short_name_feature_name -%} + "{{feature_name}}", {% endfor -%} ] -{% for (short_name, full_name) in short_name_full_name -%} -{{full_name}} = ["dep:icondata_{{short_name}}"] +{% for (short_name, feature_name) in short_name_feature_name -%} +{{feature_name}} = ["dep:icondata_{{short_name}}"] {% endfor -%} diff --git a/build/templates/main_lib/lib.rs b/build/templates/main_lib/lib.rs index 9ad03febd..c5f796b11 100644 --- a/build/templates/main_lib/lib.rs +++ b/build/templates/main_lib/lib.rs @@ -31,8 +31,8 @@ //! [dependencies] //! icondata = { version = "...", default-features = false, features = ["lu", "bi"] } //! ``` -{% for (short_name, full_name) in short_name_full_name %} -#[cfg(feature = "{{full_name}}")] +{% for (short_name, feature_name) in short_name_feature_name %} +#[cfg(feature = "{{feature_name}}")] pub use icondata_{{short_name}}::*; {%- endfor %}