summaryrefslogtreecommitdiff
path: root/src/commands/list.rs
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2022-11-06 23:06:54 +0100
committerfxqnlr <[email protected]>2022-11-06 23:06:54 +0100
commitea50af892c4268ae06f6df40ee435eadd076228d (patch)
treedce2f1fed88f168552b8069d22d9176d7dd2879d /src/commands/list.rs
parentc33b8be79e8cfac9e2fa76c1f63c85e020cdf4a0 (diff)
downloadmodlist-ea50af892c4268ae06f6df40ee435eadd076228d.tar
modlist-ea50af892c4268ae06f6df40ee435eadd076228d.tar.gz
modlist-ea50af892c4268ae06f6df40ee435eadd076228d.zip
halfswitch to rusqlite; db tests
Diffstat (limited to 'src/commands/list.rs')
-rw-r--r--src/commands/list.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/commands/list.rs b/src/commands/list.rs
index 3dfe1ad..ffa5926 100644
--- a/src/commands/list.rs
+++ b/src/commands/list.rs
@@ -1,6 +1,6 @@
1use std::io::{Error, ErrorKind}; 1use std::io::{Error, ErrorKind};
2 2
3use crate::{db::{insert_list, remove_list, change_list, get_lists, get_current_list_id, get_list}, Modloader, config::Cfg, input::Input}; 3use crate::{db::{lists_insert, remove_list, change_list, get_lists, get_current_list_id, get_list}, Modloader, config::Cfg, input::Input};
4 4
5#[derive(Clone)] 5#[derive(Clone)]
6pub struct List { 6pub struct List {
@@ -52,8 +52,8 @@ fn add(config: Cfg, args: Vec<String>) -> Result<(), Box<dyn std::error::Error>>
52 "fabric" => Modloader::Fabric, 52 "fabric" => Modloader::Fabric,
53 _ => return Err(Box::new(Error::new(ErrorKind::InvalidInput, "UNKNOWN_MODLOADER"))) 53 _ => return Err(Box::new(Error::new(ErrorKind::InvalidInput, "UNKNOWN_MODLOADER")))
54 }; 54 };
55 match insert_list(config, id, mc_version, mod_loader) { 55 match lists_insert(config, id, mc_version, mod_loader) {
56 Err(err) => { Err(Box::new(err)) }, 56 Err(err) => { Err(Box::new(Error::new(ErrorKind::Other, "TBD"))) },
57 Ok(()) => Ok(()), 57 Ok(()) => Ok(()),
58 } 58 }
59 }, 59 },
@@ -69,7 +69,7 @@ fn change(config: Cfg, args: Vec<String>) -> Result<(), Box<dyn std::error::Erro
69 let list = String::from(&args[0]); 69 let list = String::from(&args[0]);
70 if !lists.contains(&list) { return Err(Box::new(Error::new(ErrorKind::NotFound, "LIST_DOESNT_EXIST"))); }; 70 if !lists.contains(&list) { return Err(Box::new(Error::new(ErrorKind::NotFound, "LIST_DOESNT_EXIST"))); };
71 match change_list(config, list) { 71 match change_list(config, list) {
72 Err(err) => { Err(Box::new(err)) }, 72 Err(err) => { Err(Box::new(Error::new(ErrorKind::Other, "TBD"))) },
73 Ok(()) => Ok(()), 73 Ok(()) => Ok(()),
74 } 74 }
75 }, 75 },
@@ -82,7 +82,7 @@ fn remove(config: Cfg, args: Vec<String>) -> Result<(), Box<dyn std::error::Erro
82 match args.len() { 82 match args.len() {
83 1 => { 83 1 => {
84 match remove_list(config, String::from(&args[0])) { 84 match remove_list(config, String::from(&args[0])) {
85 Err(err) => { Err(Box::new(err)) }, 85 Err(err) => { Err(Box::new(Error::new(ErrorKind::Other, "TBD"))) },
86 Ok(()) => Ok(()), 86 Ok(()) => Ok(()),
87 } 87 }
88 }, 88 },