diff --git a/src/cli.rs b/src/cli.rs index b5fbf05..c87ef89 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -123,7 +123,7 @@ pub fn tui( // Listen to the processed items let sender_paths = sender.clone(); - let sender_finished = sender.clone(); + let sender_finished = sender; std::thread::spawn(move || { paths.into_par_iter().for_each_with(sender_paths, |sender, path| { let result = crate::format::file(&config, path.clone()); diff --git a/src/format.rs b/src/format.rs index 3fe74d3..445861b 100644 --- a/src/format.rs +++ b/src/format.rs @@ -25,7 +25,7 @@ pub fn string_or_passthrough( path: String, before: String, ) -> String { - match crate::format::string(&config, path, before.clone()) { + match crate::format::string(config, path, before.clone()) { Ok(after) => after, Err(_) => before, } diff --git a/src/rules/attr_set.rs b/src/rules/attr_set.rs index 9e35069..e0e761e 100644 --- a/src/rules/attr_set.rs +++ b/src/rules/attr_set.rs @@ -80,7 +80,7 @@ pub fn rule( // /**/ children.drain_comments_and_newlines(|element| match element { crate::children::DrainCommentOrNewline::Comment(text) => { - if inline_next_comment && text.starts_with("#") { + if inline_next_comment && text.starts_with('#') { steps.push_back(crate::builder::Step::Whitespace); } else { steps.push_back(crate::builder::Step::NewLine); diff --git a/src/rules/let_in.rs b/src/rules/let_in.rs index 853c3d9..10e1fc1 100644 --- a/src/rules/let_in.rs +++ b/src/rules/let_in.rs @@ -44,7 +44,7 @@ pub fn rule( // /**/ children.drain_comments_and_newlines(|element| match element { crate::children::DrainCommentOrNewline::Comment(text) => { - if inline_next_comment && text.starts_with("#") { + if inline_next_comment && text.starts_with('#') { steps.push_back(crate::builder::Step::Whitespace); } else { steps.push_back(crate::builder::Step::NewLine); diff --git a/src/rules/list.rs b/src/rules/list.rs index 8bd9293..dc890a3 100644 --- a/src/rules/list.rs +++ b/src/rules/list.rs @@ -40,7 +40,7 @@ pub fn rule( children.drain_comments_and_newlines(|element| { match element { crate::children::DrainCommentOrNewline::Comment(text) => { - if inline_next_comment && text.starts_with("#") { + if inline_next_comment && text.starts_with('#') { steps.push_back(crate::builder::Step::Whitespace); } else { steps.push_back(crate::builder::Step::NewLine);