summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2023-01-11 17:31:17 +0100
committerfxqnlr <[email protected]>2023-01-11 17:31:17 +0100
commitfad32c31b59001bed46fa860fbc3a994d278e700 (patch)
tree4793c6bdd3429275463bd9c75ce0648b9733fd85
parent92bda65a9983e60036b3d49333e9bfe9bcd0543f (diff)
downloadmodlist-fad32c31b59001bed46fa860fbc3a994d278e700.tar
modlist-fad32c31b59001bed46fa860fbc3a994d278e700.tar.gz
modlist-fad32c31b59001bed46fa860fbc3a994d278e700.zip
cargo update, minor error impls
-rw-r--r--Cargo.lock102
-rw-r--r--src/commands/list.rs9
-rw-r--r--src/db.rs2
3 files changed, 36 insertions, 77 deletions
diff --git a/Cargo.lock b/Cargo.lock
index ac1cd5e..dadb2e1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -137,9 +137,9 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
137 137
138[[package]] 138[[package]]
139name = "cxx" 139name = "cxx"
140version = "1.0.85" 140version = "1.0.86"
141source = "registry+https://github.com/rust-lang/crates.io-index" 141source = "registry+https://github.com/rust-lang/crates.io-index"
142checksum = "5add3fc1717409d029b20c5b6903fc0c0b02fa6741d820054f4a2efa5e5816fd" 142checksum = "51d1075c37807dcf850c379432f0df05ba52cc30f279c5cfc43cc221ce7f8579"
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.85" 152version = "1.0.86"
153source = "registry+https://github.com/rust-lang/crates.io-index" 153source = "registry+https://github.com/rust-lang/crates.io-index"
154checksum = "b4c87959ba14bc6fbc61df77c3fcfe180fc32b93538c4f1031dd802ccb5f2ff0" 154checksum = "5044281f61b27bc598f2f6647d480aed48d2bf52d6eb0b627d84c0361b17aa70"
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.85" 167version = "1.0.86"
168source = "registry+https://github.com/rust-lang/crates.io-index" 168source = "registry+https://github.com/rust-lang/crates.io-index"
169checksum = "69a3e162fde4e594ed2b07d0f83c6c67b745e7f28ce58c6df5e6b6bef99dfb59" 169checksum = "61b50bc93ba22c27b0d31128d2d130a0a6b3d267ae27ef7e4fae2167dfe8781c"
170 170
171[[package]] 171[[package]]
172name = "cxxbridge-macro" 172name = "cxxbridge-macro"
173version = "1.0.85" 173version = "1.0.86"
174source = "registry+https://github.com/rust-lang/crates.io-index" 174source = "registry+https://github.com/rust-lang/crates.io-index"
175checksum = "3e7e2adeb6a0d4a282e581096b06e1791532b7d576dcde5ccd9382acf55db8e6" 175checksum = "39e61fda7e62115119469c7b3591fd913ecca96fb766cfd3f2e2502ab7bc87a5"
176dependencies = [ 176dependencies = [
177 "proc-macro2", 177 "proc-macro2",
178 "quote", 178 "quote",
@@ -510,9 +510,9 @@ dependencies = [
510 510
511[[package]] 511[[package]]
512name = "ipnet" 512name = "ipnet"
513version = "2.7.0" 513version = "2.7.1"
514source = "registry+https://github.com/rust-lang/crates.io-index" 514source = "registry+https://github.com/rust-lang/crates.io-index"
515checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" 515checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146"
516 516
517[[package]] 517[[package]]
518name = "itoa" 518name = "itoa"
@@ -610,7 +610,7 @@ dependencies = [
610 "libc", 610 "libc",
611 "log", 611 "log",
612 "wasi 0.11.0+wasi-snapshot-preview1", 612 "wasi 0.11.0+wasi-snapshot-preview1",
613 "windows-sys 0.42.0", 613 "windows-sys",
614] 614]
615 615
616[[package]] 616[[package]]
@@ -678,18 +678,18 @@ dependencies = [
678 678
679[[package]] 679[[package]]
680name = "object" 680name = "object"
681version = "0.30.0" 681version = "0.30.2"
682source = "registry+https://github.com/rust-lang/crates.io-index" 682source = "registry+https://github.com/rust-lang/crates.io-index"
683checksum = "239da7f290cfa979f43f85a8efeee9a8a76d0827c356d37f9d3d7254d6b537fb" 683checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83"
684dependencies = [ 684dependencies = [
685 "memchr", 685 "memchr",
686] 686]
687 687
688[[package]] 688[[package]]
689name = "once_cell" 689name = "once_cell"
690version = "1.16.0" 690version = "1.17.0"
691source = "registry+https://github.com/rust-lang/crates.io-index" 691source = "registry+https://github.com/rust-lang/crates.io-index"
692checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" 692checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
693 693
694[[package]] 694[[package]]
695name = "openssl" 695name = "openssl"
@@ -756,7 +756,7 @@ dependencies = [
756 "libc", 756 "libc",
757 "redox_syscall", 757 "redox_syscall",
758 "smallvec", 758 "smallvec",
759 "windows-sys 0.42.0", 759 "windows-sys",
760] 760]
761 761
762[[package]] 762[[package]]
@@ -896,12 +896,11 @@ checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde"
896 896
897[[package]] 897[[package]]
898name = "schannel" 898name = "schannel"
899version = "0.1.20" 899version = "0.1.21"
900source = "registry+https://github.com/rust-lang/crates.io-index" 900source = "registry+https://github.com/rust-lang/crates.io-index"
901checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" 901checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3"
902dependencies = [ 902dependencies = [
903 "lazy_static", 903 "windows-sys",
904 "windows-sys 0.36.1",
905] 904]
906 905
907[[package]] 906[[package]]
@@ -1098,9 +1097,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
1098 1097
1099[[package]] 1098[[package]]
1100name = "tokio" 1099name = "tokio"
1101version = "1.23.0" 1100version = "1.24.1"
1102source = "registry+https://github.com/rust-lang/crates.io-index" 1101source = "registry+https://github.com/rust-lang/crates.io-index"
1103checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" 1102checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae"
1104dependencies = [ 1103dependencies = [
1105 "autocfg", 1104 "autocfg",
1106 "bytes", 1105 "bytes",
@@ -1113,7 +1112,7 @@ dependencies = [
1113 "signal-hook-registry", 1112 "signal-hook-registry",
1114 "socket2", 1113 "socket2",
1115 "tokio-macros", 1114 "tokio-macros",
1116 "windows-sys 0.42.0", 1115 "windows-sys",
1117] 1116]
1118 1117
1119[[package]] 1118[[package]]
@@ -1188,9 +1187,9 @@ dependencies = [
1188 1187
1189[[package]] 1188[[package]]
1190name = "try-lock" 1189name = "try-lock"
1191version = "0.2.3" 1190version = "0.2.4"
1192source = "registry+https://github.com/rust-lang/crates.io-index" 1191source = "registry+https://github.com/rust-lang/crates.io-index"
1193checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 1192checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
1194 1193
1195[[package]] 1194[[package]]
1196name = "unicode-bidi" 1195name = "unicode-bidi"
@@ -1373,30 +1372,17 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
1373 1372
1374[[package]] 1373[[package]]
1375name = "windows-sys" 1374name = "windows-sys"
1376version = "0.36.1"
1377source = "registry+https://github.com/rust-lang/crates.io-index"
1378checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
1379dependencies = [
1380 "windows_aarch64_msvc 0.36.1",
1381 "windows_i686_gnu 0.36.1",
1382 "windows_i686_msvc 0.36.1",
1383 "windows_x86_64_gnu 0.36.1",
1384 "windows_x86_64_msvc 0.36.1",
1385]
1386
1387[[package]]
1388name = "windows-sys"
1389version = "0.42.0" 1375version = "0.42.0"
1390source = "registry+https://github.com/rust-lang/crates.io-index" 1376source = "registry+https://github.com/rust-lang/crates.io-index"
1391checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" 1377checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
1392dependencies = [ 1378dependencies = [
1393 "windows_aarch64_gnullvm", 1379 "windows_aarch64_gnullvm",
1394 "windows_aarch64_msvc 0.42.0", 1380 "windows_aarch64_msvc",
1395 "windows_i686_gnu 0.42.0", 1381 "windows_i686_gnu",
1396 "windows_i686_msvc 0.42.0", 1382 "windows_i686_msvc",
1397 "windows_x86_64_gnu 0.42.0", 1383 "windows_x86_64_gnu",
1398 "windows_x86_64_gnullvm", 1384 "windows_x86_64_gnullvm",
1399 "windows_x86_64_msvc 0.42.0", 1385 "windows_x86_64_msvc",
1400] 1386]
1401 1387
1402[[package]] 1388[[package]]
@@ -1407,48 +1393,24 @@ checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
1407 1393
1408[[package]] 1394[[package]]
1409name = "windows_aarch64_msvc" 1395name = "windows_aarch64_msvc"
1410version = "0.36.1"
1411source = "registry+https://github.com/rust-lang/crates.io-index"
1412checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
1413
1414[[package]]
1415name = "windows_aarch64_msvc"
1416version = "0.42.0" 1396version = "0.42.0"
1417source = "registry+https://github.com/rust-lang/crates.io-index" 1397source = "registry+https://github.com/rust-lang/crates.io-index"
1418checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" 1398checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
1419 1399
1420[[package]] 1400[[package]]
1421name = "windows_i686_gnu" 1401name = "windows_i686_gnu"
1422version = "0.36.1"
1423source = "registry+https://github.com/rust-lang/crates.io-index"
1424checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
1425
1426[[package]]
1427name = "windows_i686_gnu"
1428version = "0.42.0" 1402version = "0.42.0"
1429source = "registry+https://github.com/rust-lang/crates.io-index" 1403source = "registry+https://github.com/rust-lang/crates.io-index"
1430checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" 1404checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
1431 1405
1432[[package]] 1406[[package]]
1433name = "windows_i686_msvc" 1407name = "windows_i686_msvc"
1434version = "0.36.1"
1435source = "registry+https://github.com/rust-lang/crates.io-index"
1436checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
1437
1438[[package]]
1439name = "windows_i686_msvc"
1440version = "0.42.0" 1408version = "0.42.0"
1441source = "registry+https://github.com/rust-lang/crates.io-index" 1409source = "registry+https://github.com/rust-lang/crates.io-index"
1442checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" 1410checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
1443 1411
1444[[package]] 1412[[package]]
1445name = "windows_x86_64_gnu" 1413name = "windows_x86_64_gnu"
1446version = "0.36.1"
1447source = "registry+https://github.com/rust-lang/crates.io-index"
1448checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
1449
1450[[package]]
1451name = "windows_x86_64_gnu"
1452version = "0.42.0" 1414version = "0.42.0"
1453source = "registry+https://github.com/rust-lang/crates.io-index" 1415source = "registry+https://github.com/rust-lang/crates.io-index"
1454checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" 1416checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
@@ -1461,12 +1423,6 @@ checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
1461 1423
1462[[package]] 1424[[package]]
1463name = "windows_x86_64_msvc" 1425name = "windows_x86_64_msvc"
1464version = "0.36.1"
1465source = "registry+https://github.com/rust-lang/crates.io-index"
1466checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
1467
1468[[package]]
1469name = "windows_x86_64_msvc"
1470version = "0.42.0" 1426version = "0.42.0"
1471source = "registry+https://github.com/rust-lang/crates.io-index" 1427source = "registry+https://github.com/rust-lang/crates.io-index"
1472checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" 1428checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
diff --git a/src/commands/list.rs b/src/commands/list.rs
index a02f8b1..3998cce 100644
--- a/src/commands/list.rs
+++ b/src/commands/list.rs
@@ -23,7 +23,10 @@ pub async fn list(config: Cfg, input: Input) -> Result<(), Box<dyn std::error::E
23 change(config, input.args) 23 change(config, input.args)
24 }, 24 },
25 Subcmd::Remove => { 25 Subcmd::Remove => {
26 remove(config, input.args.ok_or("")?) 26 match remove(config, input.args.ok_or("")?) {
27 Ok(..) => Ok(()),
28 Err(e) => Err(Box::new(e))
29 }
27 }, 30 },
28 Subcmd::Version => { 31 Subcmd::Version => {
29 match version(config, Some(input.args.ok_or("NO_VERSION")?), Some(MCVersionType::Release)).await { 32 match version(config, Some(input.args.ok_or("NO_VERSION")?), Some(MCVersionType::Release)).await {
@@ -72,10 +75,10 @@ fn change(config: Cfg, args: Option<Vec<String>>) -> Result<(), Box<dyn std::err
72 } 75 }
73} 76}
74 77
75fn remove(config: Cfg, args: Vec<String>) -> Result<(), Box<dyn std::error::Error>> { 78fn remove(config: Cfg, args: Vec<String>) -> MLE<()> {
76 match args.len() { 79 match args.len() {
77 1 => lists_remove(config, String::from(&args[0])), 80 1 => lists_remove(config, String::from(&args[0])),
78 2.. => Err(Box::new(Error::new(ErrorKind::InvalidInput, "TOO_MANY_ARGUMENTS"))), 81 2.. => Err(MLError::new(ErrorType::ArgumentCountError, "TOO_MANY_ARGUMENTS")),
79 _ => panic!("list arguments should never be zero or lower"), 82 _ => panic!("list arguments should never be zero or lower"),
80 } 83 }
81} 84}
diff --git a/src/db.rs b/src/db.rs
index c5a972f..06c2459 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -361,7 +361,7 @@ pub fn lists_insert(config: Cfg, id: String, mc_version: String, mod_loader: Mod
361 Ok(()) 361 Ok(())
362} 362}
363 363
364pub fn lists_remove(config: Cfg, id: String) -> Result<(), Box<dyn std::error::Error>> { 364pub fn lists_remove(config: Cfg, id: String) -> MLE<()> {
365 let data = devdir(format!("{}/data.db", config.data).as_str()); 365 let data = devdir(format!("{}/data.db", config.data).as_str());
366 let connection = Connection::open(data)?; 366 let connection = Connection::open(data)?;
367 367