diff options
author | FxQnLr <[email protected]> | 2023-05-13 12:37:07 +0200 |
---|---|---|
committer | FxQnLr <[email protected]> | 2023-05-13 12:37:07 +0200 |
commit | 8398b4003b72b3eefea11d8f71897ddb48f4b0ad (patch) | |
tree | e389808b24fca06aed882177c9d70a5d9121c619 /src/db.rs | |
parent | bf8fa23bf00584e4efa3060cf8ca4932173061c9 (diff) | |
download | modlist-8398b4003b72b3eefea11d8f71897ddb48f4b0ad.tar modlist-8398b4003b72b3eefea11d8f71897ddb48f4b0ad.tar.gz modlist-8398b4003b72b3eefea11d8f71897ddb48f4b0ad.zip |
impl of set_version import
Diffstat (limited to 'src/db.rs')
-rw-r--r-- | src/db.rs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -220,7 +220,7 @@ pub fn userlist_insert( | |||
220 | Ok(()) | 220 | Ok(()) |
221 | } | 221 | } |
222 | 222 | ||
223 | pub fn userlist_get_all_ids(config: Cfg, list_id: String) -> MLE<Vec<String>> { | 223 | pub fn userlist_get_all_ids(config: Cfg, list_id: &str) -> MLE<Vec<String>> { |
224 | let data = format!("{}/data.db", config.data); | 224 | let data = format!("{}/data.db", config.data); |
225 | let connection = Connection::open(data).unwrap(); | 225 | let connection = Connection::open(data).unwrap(); |
226 | 226 | ||
@@ -329,7 +329,7 @@ pub fn userlist_get_current_version(config: Cfg, list_id: &str, mod_id: &str) -> | |||
329 | pub fn userlist_get_all_current_version_ids( | 329 | pub fn userlist_get_all_current_version_ids( |
330 | config: Cfg, | 330 | config: Cfg, |
331 | list_id: String, | 331 | list_id: String, |
332 | ) -> Result<Vec<String>, Box<dyn std::error::Error>> { | 332 | ) -> MLE<Vec<String>> { |
333 | let data = format!("{}/data.db", config.data); | 333 | let data = format!("{}/data.db", config.data); |
334 | let connection = Connection::open(data)?; | 334 | let connection = Connection::open(data)?; |
335 | 335 | ||
@@ -343,10 +343,10 @@ pub fn userlist_get_all_current_version_ids( | |||
343 | } | 343 | } |
344 | 344 | ||
345 | if versions.is_empty() { | 345 | if versions.is_empty() { |
346 | return Err(Box::new(std::io::Error::new( | 346 | return Err(MLError::new( |
347 | ErrorKind::Other, | 347 | ErrorType::DBError, |
348 | "NO_MODS_ON_LIST", | 348 | "NO_MODS_ON_LIST", |
349 | ))); | 349 | )); |
350 | }; | 350 | }; |
351 | 351 | ||
352 | Ok(versions) | 352 | Ok(versions) |