From 7b6cb56066006d9b9611993bc36569058cf65b31 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sat, 11 Jan 2025 16:40:18 +0100 Subject: [PATCH] fix --- src/external/database/sql/mod.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/external/database/sql/mod.rs b/src/external/database/sql/mod.rs index 0f2b445..c8ded2f 100644 --- a/src/external/database/sql/mod.rs +++ b/src/external/database/sql/mod.rs @@ -156,7 +156,7 @@ impl ISqlDatabaseBackend<'conn>> IDatabase for SqlDatabase let version = tx .select_database_version()? - .ok_or_else(|| LoadError::SerDeError(String::from("missing database version")))?; + .ok_or_else(|| Error::SerDeError(String::from("missing database version")))?; let database = match version.as_str() { V20250103 => { @@ -164,14 +164,10 @@ impl ISqlDatabaseBackend<'conn>> IDatabase for SqlDatabase for artist in coll.iter_mut() { artist.albums.extend(tx.select_artist_albums(&artist.name)?); } - DeserializeDatabase::V20250103(coll) + Ok(DeserializeDatabase::V20250103(coll)) } - s => { - return Err(LoadError::SerDeError(format!( - "unknown database version: {s}" - ))) - } - }; + s => Err(Error::SerDeError(format!("unknown database version: {s}"))), + }?; tx.commit()?; Ok(database.into())