1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-07-30 12:07:46 +00:00

refac: unused value

This commit is contained in:
Kevin Amado 2024-11-03 17:58:21 -07:00
parent 728f44c099
commit 109edc357e
8 changed files with 20 additions and 20 deletions

View file

@ -2,7 +2,7 @@ use std::collections::LinkedList;
pub(crate) enum Trivia { pub(crate) enum Trivia {
Comment(String), Comment(String),
Newlines(usize), Newlines,
} }
pub(crate) struct Child { pub(crate) struct Child {
@ -50,7 +50,7 @@ pub(crate) fn new(
} }
if newlines > 0 { if newlines > 0 {
trivialities.push_back(Trivia::Newlines(newlines)) trivialities.push_back(Trivia::Newlines)
} }
} }
}); });

View file

@ -36,7 +36,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
steps.push_back(crate::builder::Step::Comment(text)); steps.push_back(crate::builder::Step::Comment(text));
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }

View file

@ -64,7 +64,7 @@ pub(crate) fn rule_with_configuration(
steps.push_back(crate::builder::Step::NewLine); steps.push_back(crate::builder::Step::NewLine);
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }
@ -91,7 +91,7 @@ pub(crate) fn rule_with_configuration(
steps.push_back(crate::builder::Step::NewLine); steps.push_back(crate::builder::Step::NewLine);
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }
} else if !second.has_inline_comment } else if !second.has_inline_comment

View file

@ -41,7 +41,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::NewLine); steps.push_back(crate::builder::Step::NewLine);
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }
@ -66,7 +66,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
steps.push_back(crate::builder::Step::Comment(text)); steps.push_back(crate::builder::Step::Comment(text));
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }

View file

@ -29,7 +29,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
steps.push_back(crate::builder::Step::Comment(text)); steps.push_back(crate::builder::Step::Comment(text));
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }
steps.push_back(crate::builder::Step::Dedent); steps.push_back(crate::builder::Step::Dedent);
@ -69,7 +69,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::NewLine); steps.push_back(crate::builder::Step::NewLine);
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }
@ -89,7 +89,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
steps.push_back(crate::builder::Step::Comment(text)); steps.push_back(crate::builder::Step::Comment(text));
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }
steps.push_back(crate::builder::Step::Dedent); steps.push_back(crate::builder::Step::Dedent);
@ -135,7 +135,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::NewLine); steps.push_back(crate::builder::Step::NewLine);
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }
@ -155,7 +155,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
steps.push_back(crate::builder::Step::Comment(text)); steps.push_back(crate::builder::Step::Comment(text));
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }
steps.push_back(crate::builder::Step::Dedent); steps.push_back(crate::builder::Step::Dedent);

View file

@ -39,7 +39,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::NewLine); steps.push_back(crate::builder::Step::NewLine);
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }
@ -54,7 +54,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::Comment(text)); steps.push_back(crate::builder::Step::Comment(text));
steps.push_back(crate::builder::Step::NewLine); steps.push_back(crate::builder::Step::NewLine);
// Only add padding if there are no `trivialities` (that is, // Only add padding if there are no `trivialities` (that is,
// there's no extra `Newlines(_)` to be added) // there's no extra `Newlines` to be added)
// or if the first one is a comment (that is, it'll need // or if the first one is a comment (that is, it'll need
// to be indented to match the content). // to be indented to match the content).
if matches!( if matches!(
@ -84,12 +84,12 @@ pub(crate) fn rule(
// line in the output. // line in the output.
if matches!( if matches!(
trivia_iter.peek(), trivia_iter.peek(),
Some(crate::children2::Trivia::Newlines(_)) Some(crate::children2::Trivia::Newlines)
) { ) {
continue; continue;
} }
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
if not_last_child { if not_last_child {
steps.push_back(crate::builder::Step::NewLine); steps.push_back(crate::builder::Step::NewLine);

View file

@ -69,7 +69,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::NewLine); steps.push_back(crate::builder::Step::NewLine);
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }
@ -92,7 +92,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
steps.push_back(crate::builder::Step::Comment(text)); steps.push_back(crate::builder::Step::Comment(text));
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }

View file

@ -43,7 +43,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::NewLine); steps.push_back(crate::builder::Step::NewLine);
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }
@ -71,7 +71,7 @@ pub(crate) fn rule(
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
steps.push_back(crate::builder::Step::Comment(text)); steps.push_back(crate::builder::Step::Comment(text));
} }
crate::children2::Trivia::Newlines(_) => {} crate::children2::Trivia::Newlines => {}
} }
} }