diff --git a/src/database/mod.rs b/src/database/mod.rs index 47d5871..049f8ac 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -752,9 +752,7 @@ fn locate_image_exif_row( .filter(rel_path.eq(&normalized).or(rel_path.eq(&windows_form))) .first::(connection) .map_err(|e| match e { - diesel::result::Error::NotFound => { - anyhow::Error::msg("row_not_found") - } + diesel::result::Error::NotFound => anyhow::Error::msg("row_not_found"), other => anyhow::Error::from(other).context("lookup_failed"), }) } @@ -1322,11 +1320,8 @@ impl ExifDao for SqliteExifDao { // Read-modify-write under the dao mutex so the snapshot is // consistent with the value being overwritten. The mutex holds // for the duration of this closure — no other writer can race. - let current = locate_image_exif_row( - connection.deref_mut(), - library_id_val, - rel_path_val, - )?; + let current = + locate_image_exif_row(connection.deref_mut(), library_id_val, rel_path_val)?; // Snapshot only on first override. Subsequent overrides keep // the original snapshot intact so a single revert restores @@ -1380,11 +1375,8 @@ impl ExifDao for SqliteExifDao { let mut connection = self.connection.lock().expect("Unable to get ExifDao"); - let current = locate_image_exif_row( - connection.deref_mut(), - library_id_val, - rel_path_val, - )?; + let current = + locate_image_exif_row(connection.deref_mut(), library_id_val, rel_path_val)?; // No override active — nothing to revert. Return the current // row unchanged so the endpoint is idempotent.