Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce 'pretty' indentation 4=>2 #523

Merged
merged 1 commit into from
Apr 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/text/raw_text_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ static PRETTY_WHITESPACE_CONFIG: WhitespaceConfig = WhitespaceConfig {
space_between_top_level_values: "\n",
// Each value appears on its own line
space_between_nested_values: "\n",
// Values get four spaces of indentation per level of depth
indentation: " ",
// Values get two spaces of indentation per level of depth
indentation: " ",
// Field names and values are separated by a single space
space_after_field_name: " ",
// The first value in a container appears on a line by itself
Expand Down Expand Up @@ -1040,7 +1040,7 @@ mod tests {
w.step_out()
},
"[\"foo\", 21, bar]",
"[\n \"foo\",\n 21,\n bar\n]",
"[\n \"foo\",\n 21,\n bar\n]",
"[\"foo\", 21, bar]",
);
}
Expand All @@ -1058,7 +1058,7 @@ mod tests {
w.step_out()
},
"[\"foo\", 21, [bar]]",
"[\n \"foo\",\n 21,\n [\n bar\n ]\n]",
"[\n \"foo\",\n 21,\n [\n bar\n ]\n]",
"[\"foo\", 21, [bar]]",
);
}
Expand All @@ -1074,7 +1074,7 @@ mod tests {
w.step_out()
},
"(\"foo\" 21 bar)",
"(\n \"foo\"\n 21\n bar\n)",
"(\n \"foo\"\n 21\n bar\n)",
"(\"foo\" 21 bar)",
);
}
Expand All @@ -1094,7 +1094,7 @@ mod tests {
w.step_out()
},
"{a: \"foo\", b: 21, c: quux::bar}",
"{\n a: \"foo\",\n b: 21,\n c: quux::bar\n}",
"{\n a: \"foo\",\n b: 21,\n c: quux::bar\n}",
"{a: \"foo\", b: 21, c: quux::bar}",
);
}
Expand Down