mirror of
https://github.com/RGBCube/alejandra
synced 2025-08-02 05:27:45 +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
|
// Listen to the processed items
|
||||||
let sender_paths = sender.clone();
|
let sender_paths = sender.clone();
|
||||||
let sender_finished = sender.clone();
|
let sender_finished = sender;
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
paths.into_par_iter().for_each_with(sender_paths, |sender, path| {
|
paths.into_par_iter().for_each_with(sender_paths, |sender, path| {
|
||||||
let result = crate::format::file(&config, path.clone());
|
let result = crate::format::file(&config, path.clone());
|
||||||
|
|
|
@ -25,7 +25,7 @@ pub fn string_or_passthrough(
|
||||||
path: String,
|
path: String,
|
||||||
before: String,
|
before: String,
|
||||||
) -> String {
|
) -> String {
|
||||||
match crate::format::string(&config, path, before.clone()) {
|
match crate::format::string(config, path, before.clone()) {
|
||||||
Ok(after) => after,
|
Ok(after) => after,
|
||||||
Err(_) => before,
|
Err(_) => before,
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ pub fn rule(
|
||||||
// /**/
|
// /**/
|
||||||
children.drain_comments_and_newlines(|element| match element {
|
children.drain_comments_and_newlines(|element| match element {
|
||||||
crate::children::DrainCommentOrNewline::Comment(text) => {
|
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);
|
steps.push_back(crate::builder::Step::Whitespace);
|
||||||
} else {
|
} else {
|
||||||
steps.push_back(crate::builder::Step::NewLine);
|
steps.push_back(crate::builder::Step::NewLine);
|
||||||
|
|
|
@ -44,7 +44,7 @@ pub fn rule(
|
||||||
// /**/
|
// /**/
|
||||||
children.drain_comments_and_newlines(|element| match element {
|
children.drain_comments_and_newlines(|element| match element {
|
||||||
crate::children::DrainCommentOrNewline::Comment(text) => {
|
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);
|
steps.push_back(crate::builder::Step::Whitespace);
|
||||||
} else {
|
} else {
|
||||||
steps.push_back(crate::builder::Step::NewLine);
|
steps.push_back(crate::builder::Step::NewLine);
|
||||||
|
|
|
@ -40,7 +40,7 @@ pub fn rule(
|
||||||
children.drain_comments_and_newlines(|element| {
|
children.drain_comments_and_newlines(|element| {
|
||||||
match element {
|
match element {
|
||||||
crate::children::DrainCommentOrNewline::Comment(text) => {
|
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);
|
steps.push_back(crate::builder::Step::Whitespace);
|
||||||
} else {
|
} else {
|
||||||
steps.push_back(crate::builder::Step::NewLine);
|
steps.push_back(crate::builder::Step::NewLine);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue