summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock88
-rw-r--r--Cargo.toml2
-rw-r--r--src/error.rs4
-rw-r--r--src/main.rs8
-rw-r--r--tests/db.rs2
5 files changed, 55 insertions, 49 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 5cb5308..f7a63d6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -84,9 +84,9 @@ checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c"
84 84
85[[package]] 85[[package]]
86name = "cc" 86name = "cc"
87version = "1.0.77" 87version = "1.0.78"
88source = "registry+https://github.com/rust-lang/crates.io-index" 88source = "registry+https://github.com/rust-lang/crates.io-index"
89checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" 89checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d"
90 90
91[[package]] 91[[package]]
92name = "cfg-if" 92name = "cfg-if"
@@ -137,9 +137,9 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
137 137
138[[package]] 138[[package]]
139name = "cxx" 139name = "cxx"
140version = "1.0.83" 140version = "1.0.85"
141source = "registry+https://github.com/rust-lang/crates.io-index" 141source = "registry+https://github.com/rust-lang/crates.io-index"
142checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf" 142checksum = "5add3fc1717409d029b20c5b6903fc0c0b02fa6741d820054f4a2efa5e5816fd"
143dependencies = [ 143dependencies = [
144 "cc", 144 "cc",
145 "cxxbridge-flags", 145 "cxxbridge-flags",
@@ -149,9 +149,9 @@ dependencies = [
149 149
150[[package]] 150[[package]]
151name = "cxx-build" 151name = "cxx-build"
152version = "1.0.83" 152version = "1.0.85"
153source = "registry+https://github.com/rust-lang/crates.io-index" 153source = "registry+https://github.com/rust-lang/crates.io-index"
154checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39" 154checksum = "b4c87959ba14bc6fbc61df77c3fcfe180fc32b93538c4f1031dd802ccb5f2ff0"
155dependencies = [ 155dependencies = [
156 "cc", 156 "cc",
157 "codespan-reporting", 157 "codespan-reporting",
@@ -164,15 +164,15 @@ dependencies = [
164 164
165[[package]] 165[[package]]
166name = "cxxbridge-flags" 166name = "cxxbridge-flags"
167version = "1.0.83" 167version = "1.0.85"
168source = "registry+https://github.com/rust-lang/crates.io-index" 168source = "registry+https://github.com/rust-lang/crates.io-index"
169checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12" 169checksum = "69a3e162fde4e594ed2b07d0f83c6c67b745e7f28ce58c6df5e6b6bef99dfb59"
170 170
171[[package]] 171[[package]]
172name = "cxxbridge-macro" 172name = "cxxbridge-macro"
173version = "1.0.83" 173version = "1.0.85"
174source = "registry+https://github.com/rust-lang/crates.io-index" 174source = "registry+https://github.com/rust-lang/crates.io-index"
175checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6" 175checksum = "3e7e2adeb6a0d4a282e581096b06e1791532b7d576dcde5ccd9382acf55db8e6"
176dependencies = [ 176dependencies = [
177 "proc-macro2", 177 "proc-macro2",
178 "quote", 178 "quote",
@@ -357,9 +357,9 @@ dependencies = [
357 357
358[[package]] 358[[package]]
359name = "hermit-abi" 359name = "hermit-abi"
360version = "0.1.19" 360version = "0.2.6"
361source = "registry+https://github.com/rust-lang/crates.io-index" 361source = "registry+https://github.com/rust-lang/crates.io-index"
362checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 362checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
363dependencies = [ 363dependencies = [
364 "libc", 364 "libc",
365] 365]
@@ -490,15 +490,15 @@ dependencies = [
490 490
491[[package]] 491[[package]]
492name = "ipnet" 492name = "ipnet"
493version = "2.5.1" 493version = "2.7.0"
494source = "registry+https://github.com/rust-lang/crates.io-index" 494source = "registry+https://github.com/rust-lang/crates.io-index"
495checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" 495checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e"
496 496
497[[package]] 497[[package]]
498name = "itoa" 498name = "itoa"
499version = "1.0.4" 499version = "1.0.5"
500source = "registry+https://github.com/rust-lang/crates.io-index" 500source = "registry+https://github.com/rust-lang/crates.io-index"
501checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" 501checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"
502 502
503[[package]] 503[[package]]
504name = "js-sys" 504name = "js-sys"
@@ -517,9 +517,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
517 517
518[[package]] 518[[package]]
519name = "libc" 519name = "libc"
520version = "0.2.138" 520version = "0.2.139"
521source = "registry+https://github.com/rust-lang/crates.io-index" 521source = "registry+https://github.com/rust-lang/crates.io-index"
522checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" 522checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
523 523
524[[package]] 524[[package]]
525name = "libsqlite3-sys" 525name = "libsqlite3-sys"
@@ -534,9 +534,9 @@ dependencies = [
534 534
535[[package]] 535[[package]]
536name = "link-cplusplus" 536name = "link-cplusplus"
537version = "1.0.7" 537version = "1.0.8"
538source = "registry+https://github.com/rust-lang/crates.io-index" 538source = "registry+https://github.com/rust-lang/crates.io-index"
539checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" 539checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5"
540dependencies = [ 540dependencies = [
541 "cc", 541 "cc",
542] 542]
@@ -647,9 +647,9 @@ dependencies = [
647 647
648[[package]] 648[[package]]
649name = "num_cpus" 649name = "num_cpus"
650version = "1.14.0" 650version = "1.15.0"
651source = "registry+https://github.com/rust-lang/crates.io-index" 651source = "registry+https://github.com/rust-lang/crates.io-index"
652checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" 652checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
653dependencies = [ 653dependencies = [
654 "hermit-abi", 654 "hermit-abi",
655 "libc", 655 "libc",
@@ -672,9 +672,9 @@ checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"
672 672
673[[package]] 673[[package]]
674name = "openssl" 674name = "openssl"
675version = "0.10.44" 675version = "0.10.45"
676source = "registry+https://github.com/rust-lang/crates.io-index" 676source = "registry+https://github.com/rust-lang/crates.io-index"
677checksum = "29d971fd5722fec23977260f6e81aa67d2f22cadbdc2aa049f1022d9a3be1566" 677checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1"
678dependencies = [ 678dependencies = [
679 "bitflags", 679 "bitflags",
680 "cfg-if", 680 "cfg-if",
@@ -704,9 +704,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
704 704
705[[package]] 705[[package]]
706name = "openssl-sys" 706name = "openssl-sys"
707version = "0.9.79" 707version = "0.9.80"
708source = "registry+https://github.com/rust-lang/crates.io-index" 708source = "registry+https://github.com/rust-lang/crates.io-index"
709checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4" 709checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7"
710dependencies = [ 710dependencies = [
711 "autocfg", 711 "autocfg",
712 "cc", 712 "cc",
@@ -764,18 +764,18 @@ checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"
764 764
765[[package]] 765[[package]]
766name = "proc-macro2" 766name = "proc-macro2"
767version = "1.0.47" 767version = "1.0.49"
768source = "registry+https://github.com/rust-lang/crates.io-index" 768source = "registry+https://github.com/rust-lang/crates.io-index"
769checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" 769checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5"
770dependencies = [ 770dependencies = [
771 "unicode-ident", 771 "unicode-ident",
772] 772]
773 773
774[[package]] 774[[package]]
775name = "quote" 775name = "quote"
776version = "1.0.21" 776version = "1.0.23"
777source = "registry+https://github.com/rust-lang/crates.io-index" 777source = "registry+https://github.com/rust-lang/crates.io-index"
778checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" 778checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b"
779dependencies = [ 779dependencies = [
780 "proc-macro2", 780 "proc-macro2",
781] 781]
@@ -858,9 +858,9 @@ checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
858 858
859[[package]] 859[[package]]
860name = "ryu" 860name = "ryu"
861version = "1.0.11" 861version = "1.0.12"
862source = "registry+https://github.com/rust-lang/crates.io-index" 862source = "registry+https://github.com/rust-lang/crates.io-index"
863checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" 863checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde"
864 864
865[[package]] 865[[package]]
866name = "schannel" 866name = "schannel"
@@ -880,9 +880,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
880 880
881[[package]] 881[[package]]
882name = "scratch" 882name = "scratch"
883version = "1.0.2" 883version = "1.0.3"
884source = "registry+https://github.com/rust-lang/crates.io-index" 884source = "registry+https://github.com/rust-lang/crates.io-index"
885checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" 885checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2"
886 886
887[[package]] 887[[package]]
888name = "security-framework" 888name = "security-framework"
@@ -909,18 +909,18 @@ dependencies = [
909 909
910[[package]] 910[[package]]
911name = "serde" 911name = "serde"
912version = "1.0.149" 912version = "1.0.152"
913source = "registry+https://github.com/rust-lang/crates.io-index" 913source = "registry+https://github.com/rust-lang/crates.io-index"
914checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" 914checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
915dependencies = [ 915dependencies = [
916 "serde_derive", 916 "serde_derive",
917] 917]
918 918
919[[package]] 919[[package]]
920name = "serde_derive" 920name = "serde_derive"
921version = "1.0.149" 921version = "1.0.152"
922source = "registry+https://github.com/rust-lang/crates.io-index" 922source = "registry+https://github.com/rust-lang/crates.io-index"
923checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" 923checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
924dependencies = [ 924dependencies = [
925 "proc-macro2", 925 "proc-macro2",
926 "quote", 926 "quote",
@@ -929,9 +929,9 @@ dependencies = [
929 929
930[[package]] 930[[package]]
931name = "serde_json" 931name = "serde_json"
932version = "1.0.89" 932version = "1.0.91"
933source = "registry+https://github.com/rust-lang/crates.io-index" 933source = "registry+https://github.com/rust-lang/crates.io-index"
934checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" 934checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883"
935dependencies = [ 935dependencies = [
936 "itoa", 936 "itoa",
937 "ryu", 937 "ryu",
@@ -986,9 +986,9 @@ dependencies = [
986 986
987[[package]] 987[[package]]
988name = "syn" 988name = "syn"
989version = "1.0.105" 989version = "1.0.107"
990source = "registry+https://github.com/rust-lang/crates.io-index" 990source = "registry+https://github.com/rust-lang/crates.io-index"
991checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" 991checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
992dependencies = [ 992dependencies = [
993 "proc-macro2", 993 "proc-macro2",
994 "quote", 994 "quote",
@@ -1148,9 +1148,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
1148 1148
1149[[package]] 1149[[package]]
1150name = "unicode-ident" 1150name = "unicode-ident"
1151version = "1.0.5" 1151version = "1.0.6"
1152source = "registry+https://github.com/rust-lang/crates.io-index" 1152source = "registry+https://github.com/rust-lang/crates.io-index"
1153checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" 1153checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
1154 1154
1155[[package]] 1155[[package]]
1156name = "unicode-normalization" 1156name = "unicode-normalization"
diff --git a/Cargo.toml b/Cargo.toml
index c1de0fc..124c084 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
1[package] 1[package]
2name = "modlist" 2name = "modlist"
3version = "0.6.2" 3version = "0.7.0"
4edition = "2021" 4edition = "2021"
5 5
6# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 6# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/src/error.rs b/src/error.rs
index 1ac2a48..192aa76 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -12,6 +12,7 @@ pub struct MLError {
12#[derive(Debug, Deserialize)] 12#[derive(Debug, Deserialize)]
13pub enum ErrorType { 13pub enum ErrorType {
14 ArgumentError, 14 ArgumentError,
15 ArgumentCountError,
15 ConfigError, 16 ConfigError,
16 LibToml, 17 LibToml,
17 IoError, 18 IoError,
@@ -26,7 +27,8 @@ impl std::error::Error for MLError {
26impl fmt::Display for MLError { 27impl fmt::Display for MLError {
27 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 28 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
28 match self.etype { 29 match self.etype {
29 ErrorType::ArgumentError => write!(f, "ARGS"), 30 ErrorType::ArgumentError => write!(f, "Wrong argument"),
31 ErrorType::ArgumentCountError => write!(f, "Too many/too few arguments"),
30 ErrorType::ConfigError => write!(f, "CONFIG"), 32 ErrorType::ConfigError => write!(f, "CONFIG"),
31 ErrorType::LibToml => write!(f, "TOML"), 33 ErrorType::LibToml => write!(f, "TOML"),
32 ErrorType::IoError => write!(f, "IO") 34 ErrorType::IoError => write!(f, "IO")
diff --git a/src/main.rs b/src/main.rs
index a093bb7..a8aa15d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -3,6 +3,10 @@ use modlist::{config::Cfg, input::get_input};
3#[tokio::main] 3#[tokio::main]
4async fn main() { 4async fn main() {
5 let config = Cfg::init("config.toml").unwrap(); 5 let config = Cfg::init("config.toml").unwrap();
6 //TODO Error Handling 6 match get_input(config).await {
7 get_input(config).await.unwrap(); 7 Ok(..) => (),
8 Err(e) => {
9 println!("{}", e);
10 }
11 };
8} 12}
diff --git a/tests/db.rs b/tests/db.rs
index e0bdb66..992899f 100644
--- a/tests/db.rs
+++ b/tests/db.rs
@@ -7,7 +7,7 @@ static INIT: Once = Once::new();
7fn setup() -> Cfg { 7fn setup() -> Cfg {
8 let db_pathstr = "./test_tmp/db"; 8 let db_pathstr = "./test_tmp/db";
9 9
10 let config = Cfg { data: String::from(db_pathstr), downloads: String::from("-"), clean_remove: false, apis: Apis { modrinth: String::from("-") } }; 10 let config = Cfg { data: String::from(db_pathstr), apis: Apis { modrinth: String::from("-") } };
11 11
12 INIT.call_once(|| { 12 INIT.call_once(|| {
13 let db_path = Path::new(db_pathstr); 13 let db_path = Path::new(db_pathstr);