From 93e61a4bd6ad8b5db1083bdd21994bf73b0b90ba Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Mon, 17 Apr 2023 20:30:16 +0200 Subject: added clap cli, modified (basically) all user interface functions; changed some functions to easier string handling --- src/db.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/db.rs') diff --git a/src/db.rs b/src/db.rs index 9428466..2c48cab 100644 --- a/src/db.rs +++ b/src/db.rs @@ -49,6 +49,9 @@ pub fn mods_get_all_ids(config: Cfg) -> Result, Box MLE { + + //TODO check if "slug" is id + let data = devdir(format!("{}/data.db", data).as_str()); let connection = Connection::open(data)?; @@ -192,8 +195,7 @@ pub fn userlist_get_all_ids(config: Cfg, list_id: String) -> MLE> { } } - -pub fn userlist_remove(config: Cfg, list_id: String, mod_id: String) -> MLE<()> { +pub fn userlist_remove(config: Cfg, list_id: &str, mod_id: &str) -> MLE<()> { let data = devdir(format!("{}/data.db", config.data).as_str()); let connection = Connection::open(data)?; @@ -242,7 +244,7 @@ pub fn userlist_get_all_applicable_versions_with_mods(config: Cfg, list_id: Stri Ok(versions) } -pub fn userlist_get_current_version(config: Cfg, list_id: String, mod_id: String) -> MLE { +pub fn userlist_get_current_version(config: Cfg, list_id: &str, mod_id: &str) -> MLE { let data = devdir(format!("{}/data.db", config.data).as_str()); let connection = Connection::open(data).unwrap(); @@ -425,7 +427,7 @@ pub fn lists_get(config: Cfg, list_id: String) -> MLE { Ok(list) } -pub fn lists_version(config: Cfg, list_id: String, version: String) -> MLE<()> { +pub fn lists_version(config: Cfg, list_id: &str, version: &str) -> MLE<()> { let data = devdir(format!("{}/data.db", config.data).as_str()); let connection = Connection::open(data).unwrap(); -- cgit v1.2.3