From 8398b4003b72b3eefea11d8f71897ddb48f4b0ad Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Sat, 13 May 2023 12:37:07 +0200 Subject: impl of set_version import --- src/db.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/db.rs') diff --git a/src/db.rs b/src/db.rs index 9ffbfe5..8fd21b1 100644 --- a/src/db.rs +++ b/src/db.rs @@ -220,7 +220,7 @@ pub fn userlist_insert( Ok(()) } -pub fn userlist_get_all_ids(config: Cfg, list_id: String) -> MLE> { +pub fn userlist_get_all_ids(config: Cfg, list_id: &str) -> MLE> { let data = format!("{}/data.db", config.data); let connection = Connection::open(data).unwrap(); @@ -329,7 +329,7 @@ pub fn userlist_get_current_version(config: Cfg, list_id: &str, mod_id: &str) -> pub fn userlist_get_all_current_version_ids( config: Cfg, list_id: String, -) -> Result, Box> { +) -> MLE> { let data = format!("{}/data.db", config.data); let connection = Connection::open(data)?; @@ -343,10 +343,10 @@ pub fn userlist_get_all_current_version_ids( } if versions.is_empty() { - return Err(Box::new(std::io::Error::new( - ErrorKind::Other, + return Err(MLError::new( + ErrorType::DBError, "NO_MODS_ON_LIST", - ))); + )); }; Ok(versions) -- cgit v1.2.3