From 2e8717a05757919f950ae958f52d5d94f7a35ae5 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 26 Jul 2026 19:27:27 -0400 Subject: [PATCH] desktop: rustfmt the two new preference helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verified locally this time rather than in CI. The ci-tauri image is already on this machine, so `cargo fmt --check` can run in a throwaway container against the exact toolchain CI uses — no test run, no build, no local stack, just the formatter. Four consecutive pushes had failed on formatting alone; that class of failure is now catchable before it costs a cycle. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01SreJkbxB4gx8pPsu8QbLPi --- desktop/src-tauri/src/local/store.rs | 6 ++++-- desktop/src-tauri/src/update.rs | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/desktop/src-tauri/src/local/store.rs b/desktop/src-tauri/src/local/store.rs index 854ce78..1cf96b5 100644 --- a/desktop/src-tauri/src/local/store.rs +++ b/desktop/src-tauri/src/local/store.rs @@ -683,8 +683,10 @@ pub fn record_pending_delete(conn: &Connection, entity: &str, id: &str) -> rusql /// default rather than one being invented here — the meaning of "unset" belongs /// with the setting, not with the storage. pub fn pref(conn: &Connection, key: &str) -> rusqlite::Result> { - conn.query_row("SELECT value FROM prefs WHERE key = ?1", [key], |r| r.get(0)) - .optional() + conn.query_row("SELECT value FROM prefs WHERE key = ?1", [key], |r| { + r.get(0) + }) + .optional() } pub fn set_pref(conn: &Connection, key: &str, value: &str) -> rusqlite::Result<()> { diff --git a/desktop/src-tauri/src/update.rs b/desktop/src-tauri/src/update.rs index 22c2da9..ecfc7e0 100644 --- a/desktop/src-tauri/src/update.rs +++ b/desktop/src-tauri/src/update.rs @@ -92,7 +92,10 @@ fn self_update_blocker() -> Option { fn read_channel(db: &State<'_, Db>) -> Result { let conn = db.0.lock().map_err(|e| e.to_string())?; let raw = store::pref(&conn, CHANNEL_PREF).map_err(|e| e.to_string())?; - Ok(raw.as_deref().map(Channel::parse).unwrap_or(Channel::Stable)) + Ok(raw + .as_deref() + .map(Channel::parse) + .unwrap_or(Channel::Stable)) } #[tauri::command]