Skip to content

Commit a848f1e

Browse files
committed
πŸ“ docs: say what the comments now describe
1 parent 4f7ee55 commit a848f1e

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

β€Žcommon/src/layout.rsβ€Ž

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,7 @@ fn space(width: usize) -> Padding<'static> {
257257
padding
258258
}
259259

260-
/// The comments in a run, each with the spacing that preceded it, so a comment keeps the column an
261-
/// earlier alignment pass gave it.
262-
/// The comments in a run: the spacing that preceded each, its text, and whether a line break came
263-
/// first, which is what tells a comment of its own from one trailing the line before.
260+
/// The comments a run holds, in the order they were written.
264261
fn comments_of(padding: &Padding<'_>) -> Vec<String> {
265262
padding
266263
.parts()

β€Žcommon/src/nesting.rsβ€Ž

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
77
use toml_doc::{Document, Entry, InlineTable, Key, KeyPart, Section, SectionKind, Value};
88

9-
/// Fold every `[name.sub]` into `[name]` as `sub.key` entries.
9+
/// Fold every `[name.sub]` into `[name]` as `sub.key` entries, and every `[[name.sub]]` into
10+
/// `sub = [ { ... } ]`.
1011
///
11-
/// A repeated header, an array of tables, or a sub-table that still has tables of its own beneath
12-
/// it stays where it is, since none of those survive the move.
12+
/// A repeated header, or a sub-table that still has tables of its own beneath it, stays where it
13+
/// is: neither survives the move.
1314
pub fn collapse(document: &mut Document<'_>, name: &str) {
1415
collapse_where(document, name, &|_| true, usize::MAX);
1516
}

β€Žcommon/src/sections.rsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pub fn reorder_within(
210210
leaf.to_lowercase(),
211211
)
212212
});
213-
// reordering breaks whatever spacing the file had, so every table starts one line apart; the
213+
// reordering breaks whatever spacing the file had, so the tables land one line apart; the
214214
// spacing pass then widens or closes the gaps it cares about
215215
let opens_next: Vec<bool> = document
216216
.sections

β€Žcommon/src/strings.rsβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ fn form(text: &str, quoting: Quoting, unchanged: bool, wrap: Option<Wrap<'_>>) -
8989
if quoting.is_multiline() && text.contains('\n') {
9090
return Some(multiline_repr(&preserving_newlines(text)));
9191
}
92-
// a newline written as an escape stays one; only a string already spread over lines keeps its
92+
// a newline written as `\n` stays an escape; only a string already spread over lines keeps its
93+
// breaks, which the branch above handles
9394
Some(Repr::basic_string(text))
9495
}
9596

0 commit comments

Comments
Β (0)