core: what rustfmt actually wanted
Three from the checker's own diff. Two are the rule I had guessed at: when a call overflows and its last argument is a closure, rustfmt keeps the earlier arguments on the line and expands the closure into a block, rather than putting every argument on its own line. The third is a stray double blank line before the test module.
This commit is contained in:
@@ -396,7 +396,10 @@ mod tests {
|
|||||||
assert_eq!(append_item("a note", "milk", false), "a note\n\n- [ ] milk");
|
assert_eq!(append_item("a note", "milk", false), "a note\n\n- [ ] milk");
|
||||||
// Nothing between consecutive items.
|
// Nothing between consecutive items.
|
||||||
let one = "a note\n\n- [ ] milk";
|
let one = "a note\n\n- [ ] milk";
|
||||||
assert_eq!(append_item(one, "eggs", false), format!("{one}\n- [ ] eggs"));
|
assert_eq!(
|
||||||
|
append_item(one, "eggs", false),
|
||||||
|
format!("{one}\n- [ ] eggs")
|
||||||
|
);
|
||||||
// A list-only note starts at the first line.
|
// A list-only note starts at the first line.
|
||||||
assert_eq!(append_item("", "milk", false), "- [ ] milk");
|
assert_eq!(append_item("", "milk", false), "- [ ] milk");
|
||||||
assert_eq!(append_item("\n\n", "milk", false), "- [ ] milk");
|
assert_eq!(append_item("\n\n", "milk", false), "- [ ] milk");
|
||||||
|
|||||||
@@ -222,11 +222,9 @@ fn migrate_v8(conn: &Connection) -> rusqlite::Result<()> {
|
|||||||
|
|
||||||
for (note_id, items) in grouped {
|
for (note_id, items) in grouped {
|
||||||
let existing: Option<String> = conn
|
let existing: Option<String> = conn
|
||||||
.query_row(
|
.query_row("SELECT body FROM notes WHERE id = ?1", [¬e_id], |r| {
|
||||||
"SELECT body FROM notes WHERE id = ?1",
|
r.get(0)
|
||||||
[¬e_id],
|
})
|
||||||
|r| r.get(0),
|
|
||||||
)
|
|
||||||
.optional()?;
|
.optional()?;
|
||||||
// An item whose note is already gone has nothing to fold into. The foreign key
|
// An item whose note is already gone has nothing to fold into. The foreign key
|
||||||
// should make this impossible; skipping costs nothing, and failing here would
|
// should make this impossible; skipping costs nothing, and failing here would
|
||||||
@@ -290,7 +288,6 @@ pub fn migrate(conn: &Connection) -> rusqlite::Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|||||||
Reference in New Issue
Block a user