diff options
author | fx <[email protected]> | 2023-05-13 17:28:00 +0200 |
---|---|---|
committer | fx <[email protected]> | 2023-05-13 17:28:00 +0200 |
commit | 5a2ea0755b29a8811aeeec1c73679c5783082628 (patch) | |
tree | db2aaedda9678465763993eeec15bd20673394e8 /src/db.rs | |
parent | 9063a041f6b2e72f6e4a861c77ac16065dd5378b (diff) | |
parent | 3b9d717ecd61bd2b5c32ec117f38c7d67a109748 (diff) | |
download | modlist-5a2ea0755b29a8811aeeec1c73679c5783082628.tar modlist-5a2ea0755b29a8811aeeec1c73679c5783082628.tar.gz modlist-5a2ea0755b29a8811aeeec1c73679c5783082628.zip |
Merge pull request 'todos' (#5) from todos into master
Reviewed-on: http://raspberrypi.fritz.box:7920/fx/modlist/pulls/5
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) |