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

refactor: remove commented code

This commit is contained in:
Kevin Amado 2022-02-21 12:46:49 -05:00
parent 9d23d257c6
commit ef80695a28

View file

@ -199,9 +199,6 @@ fn dedent_comment(pos: &crate::position::Position, text: &str) -> String {
return "/**/".to_string();
}
// println!("{:?}", lines);
// println!("0\n{0:<1$}/*{2}*/\n", "", pos.column, lines.join("\n"));
// Make sure it starts with empty line
if lines.len() == 1 {
lines.insert(0, "".to_string());
@ -213,9 +210,6 @@ fn dedent_comment(pos: &crate::position::Position, text: &str) -> String {
lines[1] = format!("{0:<1$}{2}", "", pos.column + 2, lines[1]);
}
// println!("{:?}", lines);
// println!("1\n{0:<1$}/*{2}*/\n", "", pos.column, lines.join("\n"));
// Make sure it ends with empty line
let len = lines.len();
if len == 2 {
@ -226,9 +220,6 @@ fn dedent_comment(pos: &crate::position::Position, text: &str) -> String {
lines.push(format!("{0:<1$}", "", pos.column + 1));
}
// println!("{:?}", lines);
// println!("2\n{0:<1$}/*{2}*/\n", "", pos.column, lines.join("\n"));
// Compute the distance to the first character from the left
let mut indentation: usize = usize::MAX;
for (index, line) in lines.iter().enumerate() {
@ -269,10 +260,6 @@ fn dedent_comment(pos: &crate::position::Position, text: &str) -> String {
})
.collect();
// println!("{:?}", lines);
// println!("3\n{0:<1$}/*{2}*/\n", "", pos.column, lines.join("\n"));
// println!("indentation={} pos.column{}", indentation, pos.column);
// Dedent everything as much as possible so that upstream components
// can indent as they see convenient
lines = lines
@ -289,9 +276,6 @@ fn dedent_comment(pos: &crate::position::Position, text: &str) -> String {
})
.collect();
// println!("{:?}", lines);
// println!("4\n{0:<1$}/*{2}*/\n", "", pos.column, lines.join("\n"));
format!("/*{}*/", lines.join("\n"))
}
}