1
Fork 0
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:
Kevin Amado 2022-02-21 13:06:28 -05:00
parent a7c7644475
commit bf47460249
5 changed files with 5 additions and 5 deletions

View file

@ -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());

View file

@ -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,
}

View file

@ -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);

View file

@ -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);

View file

@ -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);