aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev_tools/src/bin/ci.rs1
-rw-r--r--mingling/src/lib.rs18
-rw-r--r--mingling/src/res/dirs/current_dir.rs14
-rw-r--r--mingling/src/res/dirs/current_exe.rs12
-rw-r--r--mingling/src/res/dirs/home_dir.rs13
-rw-r--r--mingling/src/res/dirs/temp_dir.rs4
-rw-r--r--mingling/src/setups/dirs.rs5
-rw-r--r--mingling_core/src/any.rs7
-rw-r--r--mingling_core/src/asset/global_resource.rs9
-rw-r--r--mingling_core/src/renderer.rs2
-rw-r--r--mingling_core/src/renderer/structural.rs21
-rw-r--r--mingling_macros/src/dispatcher.rs5
-rw-r--r--mingling_macros/src/res_injection.rs5
-rw-r--r--mingling_macros/src/structural_data.rs1
-rw-r--r--mingling_pathf/src/error.rs31
-rw-r--r--mingling_pathf/src/module_pathf.rs10
-rw-r--r--mingling_pathf/src/patterns.rs4
-rw-r--r--mingling_pathf/src/patterns/chain.rs9
-rw-r--r--mingling_pathf/src/patterns/completion.rs9
-rw-r--r--mingling_pathf/src/patterns/help.rs9
-rw-r--r--mingling_pathf/src/patterns/pack.rs22
-rw-r--r--mingling_pathf/src/patterns/renderer.rs9
-rw-r--r--mling/src/errors/io_error.rs5
-rw-r--r--mling/src/pkg_mgr/installer.rs1
-rw-r--r--mling/src/proj_mgr/checklist_reader.rs35
25 files changed, 137 insertions, 124 deletions
diff --git a/dev_tools/src/bin/ci.rs b/dev_tools/src/bin/ci.rs
index b138fa1..f8aed79 100644
--- a/dev_tools/src/bin/ci.rs
+++ b/dev_tools/src/bin/ci.rs
@@ -219,6 +219,7 @@ fn docs_refresh() -> Result<(), i32> {
run_cmd!("cargo run --manifest-path dev_tools/Cargo.toml --bin refresh-docs")?;
run_cmd!("cargo run --manifest-path dev_tools/Cargo.toml --bin refresh-feature-mod")?;
run_cmd!("cargo run --manifest-path dev_tools/Cargo.toml --bin sync-examples")?;
+ run_cmd!("cargo fmt")?;
Ok(())
}
diff --git a/mingling/src/lib.rs b/mingling/src/lib.rs
index b4372dc..0fd4ece 100644
--- a/mingling/src/lib.rs
+++ b/mingling/src/lib.rs
@@ -118,15 +118,15 @@ pub mod macros {
pub use mingling_macros::node;
/// `pack!(StateGreet = String)` - Used to create a wrapper type for use with `Chain` and `Renderer`
pub use mingling_macros::pack;
- /// `pack_structural!(StateGreet = String)` - Like `pack!` but also marks the type for structured output
- #[cfg(feature = "structural_renderer")]
- pub use mingling_macros::pack_structural;
/// `pack_err!(ErrorUnknown)` - Used to create an error struct with automatic `name` field
#[cfg(feature = "extra_macros")]
pub use mingling_macros::pack_err;
/// `pack_err_structural!(ErrorUnknown)` - Like `pack_err!` but also marks the type for structured output
#[cfg(all(feature = "structural_renderer", feature = "extra_macros"))]
pub use mingling_macros::pack_err_structural;
+ /// `pack_structural!(StateGreet = String)` - Like `pack!` but also marks the type for structured output
+ #[cfg(feature = "structural_renderer")]
+ pub use mingling_macros::pack_structural;
#[cfg(feature = "comp")]
#[doc(hidden)]
pub use mingling_macros::program_comp_gen;
@@ -226,15 +226,9 @@ pub mod prelude {
pub use crate::macros::gen_program;
/// Re-export of the `pack` macro for creating wrapper types.
pub use crate::macros::pack;
- /// Like `pack!` but also marks the type for structured output
- #[cfg(feature = "structural_renderer")]
- pub use mingling_macros::pack_structural;
/// Re-export of the `pack_err` macro for creating error types.
#[cfg(feature = "extra_macros")]
pub use crate::macros::pack_err;
- /// Like `pack_err!` but also marks the type for structured output
- #[cfg(all(feature = "structural_renderer", feature = "extra_macros"))]
- pub use mingling_macros::pack_err_structural;
/// Re-export of the `r_print` macro for printing within a renderer context.
pub use crate::macros::r_print;
/// Re-export of the `r_println` macro for printing with a newline within a renderer
@@ -242,6 +236,12 @@ pub mod prelude {
pub use crate::macros::r_println;
/// Re-export of the `renderer` macro for defining renderer functions.
pub use crate::macros::renderer;
+ /// Like `pack_err!` but also marks the type for structured output
+ #[cfg(all(feature = "structural_renderer", feature = "extra_macros"))]
+ pub use mingling_macros::pack_err_structural;
+ /// Like `pack!` but also marks the type for structured output
+ #[cfg(feature = "structural_renderer")]
+ pub use mingling_macros::pack_structural;
/// Re-export of the `completion` macro for generating completion entries.
#[cfg(feature = "comp")]
diff --git a/mingling/src/res/dirs/current_dir.rs b/mingling/src/res/dirs/current_dir.rs
index 1de84e0..54d2b05 100644
--- a/mingling/src/res/dirs/current_dir.rs
+++ b/mingling/src/res/dirs/current_dir.rs
@@ -17,7 +17,7 @@ use std::{
/// a `Result`.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ResCurrentDir {
- cwd: PathBuf
+ cwd: PathBuf,
}
impl ResCurrentDir {
@@ -27,13 +27,17 @@ impl ResCurrentDir {
/// deleted or permissions are insufficient). Unlike the `Default` implementation, this
/// method does not panic on failure.
pub fn new() -> Result<Self, std::io::Error> {
- Ok(Self { cwd: current_dir()? })
+ Ok(Self {
+ cwd: current_dir()?,
+ })
}
}
impl Default for ResCurrentDir {
fn default() -> Self {
- Self { cwd: current_dir().unwrap() }
+ Self {
+ cwd: current_dir().unwrap(),
+ }
}
}
@@ -45,7 +49,9 @@ impl From<PathBuf> for ResCurrentDir {
impl From<&Path> for ResCurrentDir {
fn from(path: &Path) -> Self {
- Self { cwd: path.to_path_buf() }
+ Self {
+ cwd: path.to_path_buf(),
+ }
}
}
diff --git a/mingling/src/res/dirs/current_exe.rs b/mingling/src/res/dirs/current_exe.rs
index 051fcee..051f380 100644
--- a/mingling/src/res/dirs/current_exe.rs
+++ b/mingling/src/res/dirs/current_exe.rs
@@ -26,13 +26,17 @@ impl ResCurrentExe {
/// filesystem is not available on Linux, or the process handle is invalid).
/// Unlike the `Default` implementation, this method does not panic on failure.
pub fn new() -> Result<Self, std::io::Error> {
- Ok(Self { exe: current_exe()? })
+ Ok(Self {
+ exe: current_exe()?,
+ })
}
}
impl Default for ResCurrentExe {
fn default() -> Self {
- Self { exe: current_exe().unwrap() }
+ Self {
+ exe: current_exe().unwrap(),
+ }
}
}
@@ -44,7 +48,9 @@ impl From<PathBuf> for ResCurrentExe {
impl From<&Path> for ResCurrentExe {
fn from(path: &Path) -> Self {
- Self { exe: path.to_path_buf() }
+ Self {
+ exe: path.to_path_buf(),
+ }
}
}
diff --git a/mingling/src/res/dirs/home_dir.rs b/mingling/src/res/dirs/home_dir.rs
index de2e5e7..fae3055 100644
--- a/mingling/src/res/dirs/home_dir.rs
+++ b/mingling/src/res/dirs/home_dir.rs
@@ -24,15 +24,18 @@ impl ResHomeDir {
/// Returns `Err` if the home directory cannot be determined (e.g., the `HOME` or
/// `USERPROFILE` environment variable is not set).
pub fn new() -> Result<Self, std::io::Error> {
- let home = home_dir_env()
- .ok_or_else(|| std::io::Error::new(std::io::ErrorKind::NotFound, "home directory not found"))?;
+ let home = home_dir_env().ok_or_else(|| {
+ std::io::Error::new(std::io::ErrorKind::NotFound, "home directory not found")
+ })?;
Ok(Self { home })
}
}
impl Default for ResHomeDir {
fn default() -> Self {
- Self { home: home_dir_env().expect("home directory not found") }
+ Self {
+ home: home_dir_env().expect("home directory not found"),
+ }
}
}
@@ -44,7 +47,9 @@ impl From<PathBuf> for ResHomeDir {
impl From<&Path> for ResHomeDir {
fn from(path: &Path) -> Self {
- Self { home: path.to_path_buf() }
+ Self {
+ home: path.to_path_buf(),
+ }
}
}
diff --git a/mingling/src/res/dirs/temp_dir.rs b/mingling/src/res/dirs/temp_dir.rs
index f4f0dca..343d9c7 100644
--- a/mingling/src/res/dirs/temp_dir.rs
+++ b/mingling/src/res/dirs/temp_dir.rs
@@ -40,7 +40,9 @@ impl From<PathBuf> for ResTempDir {
impl From<&Path> for ResTempDir {
fn from(path: &Path) -> Self {
- Self { tmp: path.to_path_buf() }
+ Self {
+ tmp: path.to_path_buf(),
+ }
}
}
diff --git a/mingling/src/setups/dirs.rs b/mingling/src/setups/dirs.rs
index a7f81fa..1f5e2d2 100644
--- a/mingling/src/setups/dirs.rs
+++ b/mingling/src/setups/dirs.rs
@@ -1,9 +1,6 @@
use std::marker::PhantomData;
-use mingling_core::{
- ProgramCollect,
- setup::ProgramSetup,
-};
+use mingling_core::{ProgramCollect, setup::ProgramSetup};
use crate::res::{ResCurrentDir, ResCurrentExe, ResHomeDir, ResTempDir};
diff --git a/mingling_core/src/any.rs b/mingling_core/src/any.rs
index b586f09..2680f43 100644
--- a/mingling_core/src/any.rs
+++ b/mingling_core/src/any.rs
@@ -1,5 +1,5 @@
-use crate::{Groupped, ProgramCollect};
use crate::error::ChainProcessError;
+use crate::{Groupped, ProgramCollect};
#[doc(hidden)]
pub mod group;
@@ -136,7 +136,10 @@ impl<G> From<AnyOutput<G>> for ChainProcess<G> {
}
}
-impl<G> From<()> for ChainProcess<G> where G: ProgramCollect<Enum = G> {
+impl<G> From<()> for ChainProcess<G>
+where
+ G: ProgramCollect<Enum = G>,
+{
fn from(_v: ()) -> Self {
G::build_empty_result().route_chain()
}
diff --git a/mingling_core/src/asset/global_resource.rs b/mingling_core/src/asset/global_resource.rs
index 651655a..3d0af7b 100644
--- a/mingling_core/src/asset/global_resource.rs
+++ b/mingling_core/src/asset/global_resource.rs
@@ -80,9 +80,7 @@ where
/// owned value. The caller must call [`__store_res`] to write back modifications.
#[doc(hidden)]
#[must_use]
- pub fn __extract_res_mut<Res: 'static + Default + ResourceMarker + Send + Sync>(
- &self,
- ) -> Res {
+ pub fn __extract_res_mut<Res: 'static + Default + ResourceMarker + Send + Sync>(&self) -> Res {
let Ok(mut guard) = self.resources.lock() else {
return Res::res_default();
};
@@ -103,10 +101,7 @@ where
///
/// Stores a modified resource value back into the global store.
#[doc(hidden)]
- pub fn __store_res<Res: 'static + Send + Sync + ResourceMarker>(
- &self,
- val: Res,
- ) {
+ pub fn __store_res<Res: 'static + Send + Sync + ResourceMarker>(&self, val: Res) {
if let Ok(mut guard) = self.resources.lock() {
guard.insert(TypeId::of::<Res>(), Box::new(Arc::new(val)));
}
diff --git a/mingling_core/src/renderer.rs b/mingling_core/src/renderer.rs
index 435518d..6e67431 100644
--- a/mingling_core/src/renderer.rs
+++ b/mingling_core/src/renderer.rs
@@ -1,3 +1,3 @@
+pub mod render_result;
#[cfg(feature = "structural_renderer")]
pub mod structural;
-pub mod render_result;
diff --git a/mingling_core/src/renderer/structural.rs b/mingling_core/src/renderer/structural.rs
index 16ce471..30255aa 100644
--- a/mingling_core/src/renderer/structural.rs
+++ b/mingling_core/src/renderer/structural.rs
@@ -1,5 +1,6 @@
use crate::{
- StructuralRendererSetting, RenderResult, renderer::structural::error::StructuralRendererSerializeError,
+ RenderResult, StructuralRendererSetting,
+ renderer::structural::error::StructuralRendererSerializeError,
};
use serde::Serialize;
@@ -103,9 +104,7 @@ impl StructuralRenderer {
data: &T,
r: &mut RenderResult,
) -> Result<(), StructuralRendererSerializeError> {
- let pretty_config = ron::ser::PrettyConfig::new()
- .new_line("\n")
- .indentor(" ");
+ let pretty_config = ron::ser::PrettyConfig::new().new_line("\n").indentor(" ");
let ron_string = ron::ser::to_string_pretty(data, pretty_config)
.map_err(|e| StructuralRendererSerializeError::new(e.to_string()))?;
@@ -123,8 +122,8 @@ impl StructuralRenderer {
data: &T,
r: &mut RenderResult,
) -> Result<(), StructuralRendererSerializeError> {
- let toml_string =
- toml::to_string(data).map_err(|e| StructuralRendererSerializeError::new(e.to_string()))?;
+ let toml_string = toml::to_string(data)
+ .map_err(|e| StructuralRendererSerializeError::new(e.to_string()))?;
r.print(&toml_string);
Ok(())
}
@@ -196,8 +195,11 @@ mod tests {
#[test]
fn test_render_to_json_pretty() {
let mut r = RenderResult::default();
- let result =
- StructuralRenderer::render(&test_data(), &StructuralRendererSetting::JsonPretty, &mut r);
+ let result = StructuralRenderer::render(
+ &test_data(),
+ &StructuralRendererSetting::JsonPretty,
+ &mut r,
+ );
assert!(result.is_ok());
let output: String = r.into();
// Pretty JSON has newlines
@@ -261,7 +263,8 @@ mod tests {
#[test]
fn test_render_dispatches_json() {
let mut r = RenderResult::default();
- let result = StructuralRenderer::render(&test_data(), &StructuralRendererSetting::Json, &mut r);
+ let result =
+ StructuralRenderer::render(&test_data(), &StructuralRendererSetting::Json, &mut r);
assert!(result.is_ok());
assert!(!r.is_empty());
}
diff --git a/mingling_macros/src/dispatcher.rs b/mingling_macros/src/dispatcher.rs
index 36bdf31..2a7c850 100644
--- a/mingling_macros/src/dispatcher.rs
+++ b/mingling_macros/src/dispatcher.rs
@@ -217,7 +217,10 @@ pub fn register_dispatcher(input: TokenStream) -> TokenStream {
} = syn::parse_macro_input!(input as RegisterDispatcherInput);
let node_name_str = node_name.value();
- let static_name = format!("__internal_dispatcher_{}", snake_case!(node_name_str.clone()));
+ let static_name = format!(
+ "__internal_dispatcher_{}",
+ snake_case!(node_name_str.clone())
+ );
let static_ident = Ident::new(&static_name, proc_macro2::Span::call_site());
// Register node info in the global collection at compile time
diff --git a/mingling_macros/src/res_injection.rs b/mingling_macros/src/res_injection.rs
index f2952cc..09da889 100644
--- a/mingling_macros/src/res_injection.rs
+++ b/mingling_macros/src/res_injection.rs
@@ -160,10 +160,7 @@ pub(crate) fn generate_immut_resource_bindings<'a>(
/// Generates a unique binding name for a mutable resource variable.
fn mut_res_binding_name(var_name: &Ident) -> Ident {
- syn::Ident::new(
- &format!("__{}_binding", var_name),
- var_name.span(),
- )
+ syn::Ident::new(&format!("__{}_binding", var_name), var_name.span())
}
/// Wraps the function body in nested `__modify_res_and_return_route` closures for
diff --git a/mingling_macros/src/structural_data.rs b/mingling_macros/src/structural_data.rs
index 37fee0f..d556d8c 100644
--- a/mingling_macros/src/structural_data.rs
+++ b/mingling_macros/src/structural_data.rs
@@ -222,7 +222,6 @@ impl syn::parse::Parse for PackStructuralInput {
/// impl ::mingling::StructuralData for Info {}
/// ```
pub(crate) fn group_structural(input: TokenStream) -> TokenStream {
-
// Parse the same input as group!
let input_parsed = syn::parse_macro_input!(input as GroupStructuralInput);
diff --git a/mingling_pathf/src/error.rs b/mingling_pathf/src/error.rs
index 025ceed..513ec23 100644
--- a/mingling_pathf/src/error.rs
+++ b/mingling_pathf/src/error.rs
@@ -24,10 +24,7 @@ pub enum MinglingPathfinderError {
///
/// `file` is the file containing the invalid attribute.
/// `path_attr` is the value of the `#[path]` attribute.
- PathPointsOutside {
- file: PathBuf,
- path_attr: String,
- },
+ PathPointsOutside { file: PathBuf, path_attr: String },
/// No entry point file (`main.rs`, `lib.rs`, or any file under `bin/`) was found.
NoEntryPointFound,
@@ -36,23 +33,33 @@ pub enum MinglingPathfinderError {
///
/// `path` is the file that failed to parse.
/// `message` contains details from the parser.
- SynError {
- path: PathBuf,
- message: String,
- },
+ SynError { path: PathBuf, message: String },
}
impl fmt::Display for MinglingPathfinderError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::IoError(e) => write!(f, "IO error: {e}"),
- Self::ModuleNotFound { parent, module_name } => {
- write!(f, "Module `{module_name}` not found relative to {}", parent.display())
+ Self::ModuleNotFound {
+ parent,
+ module_name,
+ } => {
+ write!(
+ f,
+ "Module `{module_name}` not found relative to {}",
+ parent.display()
+ )
}
Self::PathPointsOutside { file, path_attr } => {
- write!(f, "#[path = \"{path_attr}\"] in {} points outside the project", file.display())
+ write!(
+ f,
+ "#[path = \"{path_attr}\"] in {} points outside the project",
+ file.display()
+ )
+ }
+ Self::NoEntryPointFound => {
+ write!(f, "No entry point found (main.rs, lib.rs, or bin/*.rs)")
}
- Self::NoEntryPointFound => write!(f, "No entry point found (main.rs, lib.rs, or bin/*.rs)"),
Self::SynError { path, message } => {
write!(f, "Failed to parse {}: {message}", path.display())
}
diff --git a/mingling_pathf/src/module_pathf.rs b/mingling_pathf/src/module_pathf.rs
index d06be9b..c20fd82 100644
--- a/mingling_pathf/src/module_pathf.rs
+++ b/mingling_pathf/src/module_pathf.rs
@@ -10,7 +10,6 @@ use crate::error::MinglingPathfinderError;
/// effective module path (e.g., `crate::foo::bar`).
#[derive(Debug, Clone)]
pub struct MappingItem {
-
/// The path of the source file (relative to the crate root, with `./` prefix).
file_path: PathBuf,
@@ -349,11 +348,7 @@ fn propagate_children(parent_file: &Path, ctx: &mut Context) {
.cloned()
.unwrap_or_else(|| "crate".to_string());
- let reexported = ctx
- .reexports
- .get(parent_file)
- .cloned()
- .unwrap_or_default();
+ let reexported = ctx.reexports.get(parent_file).cloned().unwrap_or_default();
let Some(children) = ctx.children.get(parent_file).cloned() else {
return;
@@ -367,8 +362,7 @@ fn propagate_children(parent_file: &Path, ctx: &mut Context) {
format!("{}::{}", parent_effective, child.name)
};
- ctx.effective_paths
- .insert(child.file.clone(), effective);
+ ctx.effective_paths.insert(child.file.clone(), effective);
propagate_children(&child.file, ctx);
}
}
diff --git a/mingling_pathf/src/patterns.rs b/mingling_pathf/src/patterns.rs
index b3e0cd3..d0bda5d 100644
--- a/mingling_pathf/src/patterns.rs
+++ b/mingling_pathf/src/patterns.rs
@@ -3,8 +3,8 @@ pub use chain::*;
pub use completion::*;
pub use dispatcher::*;
pub use dispatcher_clap::*;
-pub use groupped_derive::*;
pub use group::*;
+pub use groupped_derive::*;
pub use help::*;
pub use pack::*;
pub use renderer::*;
@@ -14,8 +14,8 @@ mod chain;
mod completion;
mod dispatcher;
mod dispatcher_clap;
-mod groupped_derive;
mod group;
+mod groupped_derive;
mod help;
mod pack;
mod renderer;
diff --git a/mingling_pathf/src/patterns/chain.rs b/mingling_pathf/src/patterns/chain.rs
index 10d698e..d64ed3b 100644
--- a/mingling_pathf/src/patterns/chain.rs
+++ b/mingling_pathf/src/patterns/chain.rs
@@ -63,10 +63,7 @@ fn collect_from_item(item: &Item, current_mod: &str, items: &mut Vec<AnalyzeItem
}
fn has_attr(attrs: &[syn::Attribute], name: &str) -> bool {
- attrs.iter().any(|a| {
- a.path()
- .segments
- .last()
- .is_some_and(|s| s.ident == name)
- })
+ attrs
+ .iter()
+ .any(|a| a.path().segments.last().is_some_and(|s| s.ident == name))
}
diff --git a/mingling_pathf/src/patterns/completion.rs b/mingling_pathf/src/patterns/completion.rs
index 7e4cd09..ff20e0f 100644
--- a/mingling_pathf/src/patterns/completion.rs
+++ b/mingling_pathf/src/patterns/completion.rs
@@ -56,10 +56,7 @@ fn collect_from_item(item: &Item, current_mod: &str, items: &mut Vec<AnalyzeItem
}
fn has_attr(attrs: &[syn::Attribute], name: &str) -> bool {
- attrs.iter().any(|a| {
- a.path()
- .segments
- .last()
- .is_some_and(|s| s.ident == name)
- })
+ attrs
+ .iter()
+ .any(|a| a.path().segments.last().is_some_and(|s| s.ident == name))
}
diff --git a/mingling_pathf/src/patterns/help.rs b/mingling_pathf/src/patterns/help.rs
index 357626b..02bfa4f 100644
--- a/mingling_pathf/src/patterns/help.rs
+++ b/mingling_pathf/src/patterns/help.rs
@@ -56,10 +56,7 @@ fn collect_from_item(item: &Item, current_mod: &str, items: &mut Vec<AnalyzeItem
}
fn has_attr(attrs: &[syn::Attribute], name: &str) -> bool {
- attrs.iter().any(|a| {
- a.path()
- .segments
- .last()
- .is_some_and(|s| s.ident == name)
- })
+ attrs
+ .iter()
+ .any(|a| a.path().segments.last().is_some_and(|s| s.ident == name))
}
diff --git a/mingling_pathf/src/patterns/pack.rs b/mingling_pathf/src/patterns/pack.rs
index f025f7d..83c1cee 100644
--- a/mingling_pathf/src/patterns/pack.rs
+++ b/mingling_pathf/src/patterns/pack.rs
@@ -40,12 +40,13 @@ impl AnalyzePattern for PackPattern {
if let Some((_, nested)) = &item_mod.content {
for n in nested {
if let Item::Macro(m) = n
- && let Some(name) = try_extract_pack_name(m) {
- items.push(AnalyzeItem {
- module: item_mod.ident.to_string(),
- item_name: name,
- });
- }
+ && let Some(name) = try_extract_pack_name(m)
+ {
+ items.push(AnalyzeItem {
+ module: item_mod.ident.to_string(),
+ item_name: name,
+ });
+ }
}
}
}
@@ -89,10 +90,11 @@ fn try_extract_pack_name(m: &syn::ItemMacro) -> Option<String> {
// Check if `=` follows
if let Some(proc_macro2::TokenTree::Punct(p)) = iter.next()
- && p.as_char() == '=' {
- // pack!(TypeName = InnerType)
- return Some(type_name);
- }
+ && p.as_char() == '='
+ {
+ // pack!(TypeName = InnerType)
+ return Some(type_name);
+ }
// pack_err!(TypeName) — only a single ident
return Some(type_name);
diff --git a/mingling_pathf/src/patterns/renderer.rs b/mingling_pathf/src/patterns/renderer.rs
index 410ae14..054769e 100644
--- a/mingling_pathf/src/patterns/renderer.rs
+++ b/mingling_pathf/src/patterns/renderer.rs
@@ -56,10 +56,7 @@ fn collect_from_item(item: &Item, current_mod: &str, items: &mut Vec<AnalyzeItem
}
fn has_attr(attrs: &[syn::Attribute], name: &str) -> bool {
- attrs.iter().any(|a| {
- a.path()
- .segments
- .last()
- .is_some_and(|s| s.ident == name)
- })
+ attrs
+ .iter()
+ .any(|a| a.path().segments.last().is_some_and(|s| s.ident == name))
}
diff --git a/mling/src/errors/io_error.rs b/mling/src/errors/io_error.rs
index 9f93ad7..92a3951 100644
--- a/mling/src/errors/io_error.rs
+++ b/mling/src/errors/io_error.rs
@@ -1,4 +1,7 @@
-use mingling::{macros::{group, r_println, renderer}, res::ResExitCode};
+use mingling::{
+ macros::{group, r_println, renderer},
+ res::ResExitCode,
+};
use crate::eformat_cargo;
diff --git a/mling/src/pkg_mgr/installer.rs b/mling/src/pkg_mgr/installer.rs
index e69de29..8b13789 100644
--- a/mling/src/pkg_mgr/installer.rs
+++ b/mling/src/pkg_mgr/installer.rs
@@ -0,0 +1 @@
+
diff --git a/mling/src/proj_mgr/checklist_reader.rs b/mling/src/proj_mgr/checklist_reader.rs
index 6d115bb..558d303 100644
--- a/mling/src/proj_mgr/checklist_reader.rs
+++ b/mling/src/proj_mgr/checklist_reader.rs
@@ -1,4 +1,4 @@
-use std::{collections::HashMap, path::Path, io};
+use std::{collections::HashMap, io, path::Path};
/// Reads and parses a `CHECKLIST.md` file, extracting both *values* (from
/// fenced code blocks) and *toggles* (from checkbox lines).
@@ -56,27 +56,28 @@ impl CheckListReader {
let line = lines[i];
if let Some(key) = line.strip_prefix("```").map(|s| s.trim())
- && !key.is_empty() && !key.starts_with(' ') {
- let mut block_lines = Vec::new();
+ && !key.is_empty()
+ && !key.starts_with(' ')
+ {
+ let mut block_lines = Vec::new();
+ i += 1;
+ while i < lines.len() && !lines[i].trim_start().starts_with("```") {
+ block_lines.push(lines[i]);
i += 1;
- while i < lines.len() && !lines[i].trim_start().starts_with("```") {
- block_lines.push(lines[i]);
- i += 1;
- }
- let value = block_lines
- .into_iter()
- .find(|l| !l.trim().is_empty())
- .map(|l| l.trim().to_string());
- if let Some(val) = value {
- self.values.insert(key.to_string(), val);
- }
- continue;
}
+ let value = block_lines
+ .into_iter()
+ .find(|l| !l.trim().is_empty())
+ .map(|l| l.trim().to_string());
+ if let Some(val) = value {
+ self.values.insert(key.to_string(), val);
+ }
+ continue;
+ }
if let Some(toggle_key) = Self::parse_toggle_line(line) {
let is_checked = line.contains("[x]") || line.contains("[X]");
- self.all_toggles
- .insert(toggle_key.clone(), is_checked);
+ self.all_toggles.insert(toggle_key.clone(), is_checked);
if is_checked {
self.toggles.insert(toggle_key, true);
}