mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-30 12:07:46 +00:00
refactor: solve clippy warnings
This commit is contained in:
parent
a7c7644475
commit
bf47460249
5 changed files with 5 additions and 5 deletions
|
@ -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());
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue