diff --git a/build/src/fs.rs b/build/src/fs.rs new file mode 100644 index 000000000..76053006f --- /dev/null +++ b/build/src/fs.rs @@ -0,0 +1,4 @@ +mod readme_md; +mod cargo_toml; +mod lib_rs; +mod src_dir; diff --git a/build/src/cargo_toml.rs b/build/src/fs/cargo_toml.rs similarity index 100% rename from build/src/cargo_toml.rs rename to build/src/fs/cargo_toml.rs diff --git a/build/src/lib_rs.rs b/build/src/fs/lib_rs.rs similarity index 99% rename from build/src/lib_rs.rs rename to build/src/fs/lib_rs.rs index c6bdd811e..ba34b4400 100644 --- a/build/src/lib_rs.rs +++ b/build/src/fs/lib_rs.rs @@ -1,7 +1,7 @@ use std::{io, path::PathBuf}; use anyhow::Result; -use heck::{ToSnakeCase, ToUpperCamelCase, ToShoutySnakeCase}; +use heck::{ToUpperCamelCase, ToShoutySnakeCase}; use proc_macro2::{Ident, Span, TokenStream}; use quote::{format_ident, quote}; use snafu::{prelude::*, Backtrace}; diff --git a/build/src/readme_md.rs b/build/src/fs/readme_md.rs similarity index 100% rename from build/src/readme_md.rs rename to build/src/fs/readme_md.rs diff --git a/build/src/src_dir.rs b/build/src/fs/src_dir.rs similarity index 100% rename from build/src/src_dir.rs rename to build/src/fs/src_dir.rs diff --git a/build/src/icon_library/mod.rs b/build/src/icon_library/mod.rs index a3418b34b..e617bfd6e 100644 --- a/build/src/icon_library/mod.rs +++ b/build/src/icon_library/mod.rs @@ -17,7 +17,6 @@ mod icons_md; #[derive(Debug)] pub(crate) struct IconLibrary { pub package: Package, - pub name: String, pub path: PathBuf, pub cargo_toml: CargoToml, pub readme_md: Readme, @@ -27,10 +26,9 @@ pub(crate) struct IconLibrary { } impl IconLibrary { - pub fn new(package: Package, name: String, root: PathBuf) -> Self { + pub fn new(package: Package, root: PathBuf) -> Self { Self { package, - name, path: root.clone(), cargo_toml: CargoToml { path: root.join("Cargo.toml"), diff --git a/build/src/main.rs b/build/src/main.rs index dc4f5ef95..ef39536f6 100644 --- a/build/src/main.rs +++ b/build/src/main.rs @@ -19,10 +19,7 @@ mod main_library; mod package; mod path; mod sem_ver; -mod readme_md; -mod cargo_toml; -mod lib_rs; -mod src_dir; +mod fs; #[derive(Debug, Parser)] #[command(author, version, about, long_about = None)] @@ -63,9 +60,8 @@ async fn main() -> Result<()> { })?; // Generate the library for that package. - let lib_name = format!("leptos-icons-{}", package.meta.short_name); - let lib_path = path::library_crate(&lib_name, ""); - let mut lib = IconLibrary::new(package, lib_name, lib_path); + let lib_path = path::library_crate(format!("leptos-icons-{}", package.meta.short_name), ""); + let mut lib = IconLibrary::new(package, lib_path); lib.generate().await?; diff --git a/build/src/main_library/mod.rs b/build/src/main_library.rs similarity index 100% rename from build/src/main_library/mod.rs rename to build/src/main_library.rs