From 142cfa68dffc94ca7c264a31c869c4a69b25232a Mon Sep 17 00:00:00 2001 From: Liam <33645555+lj3954@users.noreply.github.com> Date: Fri, 25 Oct 2024 07:31:44 -0700 Subject: [PATCH] refactor (xtask): Apply Clippy suggested changes --- xtask/src/docgen.rs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/xtask/src/docgen.rs b/xtask/src/docgen.rs index fe930be2..385c1134 100644 --- a/xtask/src/docgen.rs +++ b/xtask/src/docgen.rs @@ -24,7 +24,7 @@ pub fn userguide() -> Result { #[cfg(debug_assertions)] println!(" Directory: {}", entry.name); - if entry.name != "root".to_string() { + if entry.name != "root" { md.push_str(&format!("\n### {}\n\n", entry.name)); } @@ -36,18 +36,16 @@ pub fn userguide() -> Result { current_dir )); } */ // Commenting this for now, might be a good idea later - } else { - if !entry.description.is_empty() { - #[cfg(debug_assertions)] - println!(" Entry: {}", entry.name); - #[cfg(debug_assertions)] - println!(" Description: {}", entry.description); + } else if !entry.description.is_empty() { + #[cfg(debug_assertions)] + println!(" Entry: {}", entry.name); + #[cfg(debug_assertions)] + println!(" Description: {}", entry.description); - md.push_str(&format!("- **{}**: {}\n", entry.name, entry.description)); - } /* else { - md.push_str(&format!("- **{}**\n", entry.name)); - } */ // https://github.com/ChrisTitusTech/linutil/pull/753 - } + md.push_str(&format!("- **{}**: {}\n", entry.name, entry.description)); + } /* else { + md.push_str(&format!("- **{}**\n", entry.name)); + } */ // https://github.com/ChrisTitusTech/linutil/pull/753 } }