mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-30 12:07:46 +00:00
refac: unused value
This commit is contained in:
parent
728f44c099
commit
109edc357e
8 changed files with 20 additions and 20 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -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 => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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 => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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 => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue