Skip to content

Commit 8f9e7df

Browse files
Merge pull request #19 from thunderstore-io/spring-cleaning
Spring cleaning - format, lint, upgrade
2 parents 89b6417 + 68db613 commit 8f9e7df

38 files changed

+874
-765
lines changed

Cargo.lock

Lines changed: 515 additions & 446 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ version = "0.3.0"
44
edition = "2021"
55

66
[dependencies]
7-
once_cell = "1.17"
8-
wildmatch = "2.1"
7+
once_cell = "1.21"
8+
wildmatch = "2.4"
99
reqwest = { version = "0.11", features = ["json", "stream"] }
1010

1111
petgraph = { version = "0.6", features = ["serde-1"] }
1212

1313
# errors, ux, other user-facing communication
1414
thiserror = "1.0"
1515
miette = { version = "5.10", features = ["fancy"] }
16-
colored = "2.0"
17-
indicatif = { version = "0.17.8", features = ["improved_unicode", "tokio"] }
16+
colored = "2.2"
17+
indicatif = { version = "0.17.11", features = ["improved_unicode", "tokio"] }
1818

1919
# async runtime and helpers
2020
futures = "0.3"
2121
futures-util = "0.3"
22-
tokio = { version = "1.34", features = [
22+
tokio = { version = "1.44", features = [
2323
"macros",
2424
"process",
2525
"rt-multi-thread",
@@ -28,27 +28,27 @@ tokio-util = { version = "0.7", features = ["io"] }
2828
async-compression = { version = "0.4", features = ["futures-io", "gzip"] }
2929

3030
# parsers, serializations, and other data processing
31-
clap = { version = "4.2", features = ["derive", "color"] }
31+
clap = { version = "4.5", features = ["derive", "color"] }
3232
figment = { version = "0.10", features = ["env", "toml"] }
3333
serde = { version = "1.0", features = ["derive"] }
3434
serde_json = "1.0"
3535
serde_with = "2.3"
36-
toml = "0.7.3"
36+
toml = "0.7.8"
3737
md-5 = "0.10"
3838
base64 = "0.21"
3939

4040
# files, directories, and other fs operations
41-
walkdir = "2.3"
42-
zip = "2.2.3"
41+
walkdir = "2.5"
42+
zip = "2.6.1"
4343
directories = "5.0"
44-
steamlocate = "2.0.0-beta.2"
44+
steamlocate = "2.0.1"
4545

4646
sysinfo = "0.29"
47-
chrono = { version = "0.4.35", features = ["serde"] }
48-
log = "0.4.21"
47+
chrono = { version = "0.4.40", features = ["serde"] }
48+
log = "0.4.27"
4949

5050
[target.'cfg(windows)'.dependencies]
5151
winreg = "0.50"
5252

5353
[dev-dependencies]
54-
tempfile = "3.10"
54+
tempfile = "3.19"

src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub enum ExternSubcommand {
7676
/// Use the `list` command to query the list of imported and supported games.
7777
#[clap(long)]
7878
game_id: String,
79-
}
79+
},
8080
}
8181

8282
#[derive(Subcommand, Debug)]

src/error.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
use std::path::{Path, PathBuf};
22

3-
use crate::server::ServerError;
4-
use crate::ts::error::ApiError;
5-
63
use crate::game::error::GameError;
74
use crate::package::error::PackageError;
85
use crate::project::error::ProjectError;
6+
use crate::server::ServerError;
7+
use crate::ts::error::ApiError;
98

109
#[derive(Debug, thiserror::Error)]
1110
#[repr(u32)]
@@ -82,7 +81,10 @@ impl From<std::io::Error> for Error {
8281

8382
impl From<reqwest::Error> for Error {
8483
fn from(value: reqwest::Error) -> Self {
85-
Self::Api(ApiError::BadRequest { source: value, response_body: None })
84+
Self::Api(ApiError::BadRequest {
85+
source: value,
86+
response_body: None,
87+
})
8688
}
8789
}
8890

src/game/error.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ pub enum GameError {
1313
NotFound(String, String),
1414

1515
#[error("Could not find any of '{possible_names:?}' in base directory: '{base_path}'.")]
16-
ExeNotFound { possible_names: Vec<String>, base_path: PathBuf},
16+
ExeNotFound {
17+
possible_names: Vec<String>,
18+
base_path: PathBuf,
19+
},
1720

1821
#[error("The Steam library could not be automatically found.")]
1922
SteamDirNotFound,

src/game/import/ea.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ impl GameImporter for EaImporter {
3535
.custom_exe
3636
.clone()
3737
.or_else(|| super::find_game_exe(&r2mm.exe_names, &game_dir))
38-
.ok_or_else(|| {
39-
GameError::ExeNotFound {
40-
possible_names: r2mm.exe_names.clone(),
41-
base_path: game_dir.clone(),
42-
}})?;
38+
.ok_or_else(|| GameError::ExeNotFound {
39+
possible_names: r2mm.exe_names.clone(),
40+
base_path: game_dir.clone(),
41+
})?;
4342
let dist = ActiveDistribution {
4443
dist: GameDefPlatform::Origin {
4544
identifier: self.ident.to_string(),

src/game/import/egs.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::path::PathBuf;
44
use serde::{Deserialize, Serialize};
55

66
use super::{GameImporter, ImportBase};
7-
use crate::error::{IoError, Error};
7+
use crate::error::{Error, IoError};
88
use crate::game::error::GameError;
99
use crate::game::registry::{ActiveDistribution, GameData};
1010
use crate::ts::v1::models::ecosystem::GameDefPlatform;
@@ -81,11 +81,10 @@ impl GameImporter for EgsImporter {
8181
.custom_exe
8282
.clone()
8383
.or_else(|| super::find_game_exe(&r2mm.exe_names, &game_dir))
84-
.ok_or_else(|| {
85-
GameError::ExeNotFound {
86-
possible_names: r2mm.exe_names.clone(),
87-
base_path: game_dir.clone(),
88-
}})?;
84+
.ok_or_else(|| GameError::ExeNotFound {
85+
possible_names: r2mm.exe_names.clone(),
86+
base_path: game_dir.clone(),
87+
})?;
8988
let dist = ActiveDistribution {
9089
dist: GameDefPlatform::Other,
9190
game_dir: game_dir.to_path_buf(),

src/game/import/gamepass.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ impl GameImporter for GamepassImporter {
4949
.custom_exe
5050
.clone()
5151
.or_else(|| super::find_game_exe(&r2mm.exe_names, &game_dir))
52-
.ok_or_else(|| {
53-
GameError::ExeNotFound {
54-
possible_names: r2mm.exe_names.clone(),
55-
base_path: game_dir.clone(),
56-
}})?;
52+
.ok_or_else(|| GameError::ExeNotFound {
53+
possible_names: r2mm.exe_names.clone(),
54+
base_path: game_dir.clone(),
55+
})?;
5756
let dist = ActiveDistribution {
5857
dist: GameDefPlatform::GamePass {
5958
identifier: self.ident.to_string(),

src/game/import/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::game::import::ea::EaImporter;
1414
use crate::game::import::egs::EgsImporter;
1515
use crate::game::import::gamepass::GamepassImporter;
1616
use crate::game::import::steam::SteamImporter;
17-
use crate::ts::v1::models::ecosystem::{ GameDef, GameDefPlatform };
17+
use crate::ts::v1::models::ecosystem::{GameDef, GameDefPlatform};
1818

1919
pub trait GameImporter {
2020
fn construct(self: Box<Self>, base: ImportBase) -> Result<GameData, Error>;

src/game/import/nodrm.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::path::{Path, PathBuf};
22

3+
use super::{GameImporter, ImportBase};
34
use crate::error::{Error, IoError};
45
use crate::game::error::GameError;
5-
use super::{GameImporter, ImportBase};
66
use crate::game::registry::{ActiveDistribution, GameData};
77
use crate::ts::v1::models::ecosystem::GameDefPlatform;
88

@@ -33,8 +33,9 @@ impl GameImporter for NoDrmImporter {
3333
.custom_exe
3434
.clone()
3535
.or_else(|| super::find_game_exe(&r2mm.exe_names, &self.game_dir))
36-
.ok_or_else(|| {
37-
GameError::ExeNotFound { possible_names: r2mm.exe_names.clone(), base_path: self.game_dir.clone() }
36+
.ok_or_else(|| GameError::ExeNotFound {
37+
possible_names: r2mm.exe_names.clone(),
38+
base_path: self.game_dir.clone(),
3839
})?;
3940
let dist = ActiveDistribution {
4041
dist: GameDefPlatform::Other,

0 commit comments

Comments
 (0)