desktop: rustfmt the retention query and one assert
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SreJkbxB4gx8pPsu8QbLPi
This commit is contained in:
@@ -36,8 +36,9 @@ pub fn sweep_expired_trash(
|
|||||||
let cutoff = now - Duration::days(retention_days);
|
let cutoff = now - Duration::days(retention_days);
|
||||||
let mut expired: Vec<String> = Vec::new();
|
let mut expired: Vec<String> = Vec::new();
|
||||||
{
|
{
|
||||||
let mut stmt = conn
|
let mut stmt = conn.prepare(
|
||||||
.prepare("SELECT id, trashed_at FROM notes WHERE trashed = 1 AND trashed_at IS NOT NULL")?;
|
"SELECT id, trashed_at FROM notes WHERE trashed = 1 AND trashed_at IS NOT NULL",
|
||||||
|
)?;
|
||||||
let mut rows = stmt.query([])?;
|
let mut rows = stmt.query([])?;
|
||||||
while let Some(row) = rows.next()? {
|
while let Some(row) = rows.next()? {
|
||||||
let id: String = row.get(0)?;
|
let id: String = row.get(0)?;
|
||||||
@@ -210,7 +211,11 @@ mod tests {
|
|||||||
trashed_note(&conn, "old", 400);
|
trashed_note(&conn, "old", 400);
|
||||||
state::set_link(&conn, "https://notes.example", "token").expect("link");
|
state::set_link(&conn, "https://notes.example", "token").expect("link");
|
||||||
assert_eq!(sweep_if_unlinked(&conn).expect("sweep"), None);
|
assert_eq!(sweep_if_unlinked(&conn).expect("sweep"), None);
|
||||||
assert_eq!(note_count(&conn), 1, "the note must survive on a linked device");
|
assert_eq!(
|
||||||
|
note_count(&conn),
|
||||||
|
1,
|
||||||
|
"the note must survive on a linked device"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user