We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 627913b commit 68db613Copy full SHA for 68db613
src/cli.rs
@@ -76,7 +76,7 @@ pub enum ExternSubcommand {
76
/// Use the `list` command to query the list of imported and supported games.
77
#[clap(long)]
78
game_id: String,
79
- }
+ },
80
}
81
82
#[derive(Subcommand, Debug)]
src/error.rs
@@ -1,11 +1,10 @@
1
use std::path::{Path, PathBuf};
2
3
-use crate::server::ServerError;
4
-use crate::ts::error::ApiError;
5
-
6
use crate::game::error::GameError;
7
use crate::package::error::PackageError;
8
use crate::project::error::ProjectError;
+use crate::server::ServerError;
+use crate::ts::error::ApiError;
9
10
#[derive(Debug, thiserror::Error)]
11
#[repr(u32)]
@@ -82,7 +81,10 @@ impl From<std::io::Error> for Error {
83
impl From<reqwest::Error> for Error {
84
fn from(value: reqwest::Error) -> Self {
85
- Self::Api(ApiError::BadRequest { source: value, response_body: None })
+ Self::Api(ApiError::BadRequest {
+ source: value,
86
+ response_body: None,
87
+ })
88
89
90
src/game/error.rs
@@ -13,7 +13,10 @@ pub enum GameError {
13
NotFound(String, String),
14
15
#[error("Could not find any of '{possible_names:?}' in base directory: '{base_path}'.")]
16
- ExeNotFound { possible_names: Vec<String>, base_path: PathBuf},
+ ExeNotFound {
17
+ possible_names: Vec<String>,
18
+ base_path: PathBuf,
19
20
21
#[error("The Steam library could not be automatically found.")]
22
SteamDirNotFound,
src/game/import/ea.rs
@@ -35,11 +35,10 @@ impl GameImporter for EaImporter {
35
.custom_exe
36
.clone()
37
.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
- }})?;
+ .ok_or_else(|| GameError::ExeNotFound {
+ possible_names: r2mm.exe_names.clone(),
+ base_path: game_dir.clone(),
+ })?;
43
let dist = ActiveDistribution {
44
dist: GameDefPlatform::Origin {
45
identifier: self.ident.to_string(),
src/game/import/egs.rs
@@ -4,7 +4,7 @@ use std::path::PathBuf;
use serde::{Deserialize, Serialize};
use super::{GameImporter, ImportBase};
-use crate::error::{IoError, Error};
+use crate::error::{Error, IoError};
use crate::game::registry::{ActiveDistribution, GameData};
use crate::ts::v1::models::ecosystem::GameDefPlatform;
@@ -81,11 +81,10 @@ impl GameImporter for EgsImporter {
dist: GameDefPlatform::Other,
91
game_dir: game_dir.to_path_buf(),
src/game/import/gamepass.rs
@@ -49,11 +49,10 @@ impl GameImporter for GamepassImporter {
49
50
51
52
53
54
55
56
57
58
dist: GameDefPlatform::GamePass {
59
src/game/import/mod.rs
@@ -14,7 +14,7 @@ use crate::game::import::ea::EaImporter;
use crate::game::import::egs::EgsImporter;
use crate::game::import::gamepass::GamepassImporter;
use crate::game::import::steam::SteamImporter;
-use crate::ts::v1::models::ecosystem::{ GameDef, GameDefPlatform };
+use crate::ts::v1::models::ecosystem::{GameDef, GameDefPlatform};
pub trait GameImporter {
fn construct(self: Box<Self>, base: ImportBase) -> Result<GameData, Error>;
src/game/import/nodrm.rs
@@ -1,8 +1,8 @@
+use super::{GameImporter, ImportBase};
use crate::error::{Error, IoError};
-use super::{GameImporter, ImportBase};
@@ -33,8 +33,9 @@ impl GameImporter for NoDrmImporter {
33
34
.or_else(|| super::find_game_exe(&r2mm.exe_names, &self.game_dir))
- GameError::ExeNotFound { possible_names: r2mm.exe_names.clone(), base_path: self.game_dir.clone() }
+ base_path: self.game_dir.clone(),
})?;
src/game/import/steam.rs
@@ -40,9 +40,9 @@ impl GameImporter for SteamImporter {
.as_ref()
.map_or_else(SteamDir::locate, |x| SteamDir::from_dir(x))
.map_err(|e: steamlocate::Error| match e {
- steamlocate::Error::InvalidSteamDir(_) => {
- GameError::SteamDirBadPath(self.steam_dir.as_ref().unwrap().to_path_buf())
+ steamlocate::Error::InvalidSteamDir(_) => GameError::SteamDirBadPath(
+ self.steam_dir.as_ref().unwrap().to_path_buf(),
+ ),
46
steamlocate::Error::FailedLocate(_) => GameError::SteamDirNotFound,
47
_ => unreachable!(),
48
@@ -75,11 +75,10 @@ impl GameImporter for SteamImporter {
75
.iter()
.map(|x| app_dir.join(x))
.find(|x| x.is_file())
- base_path: app_dir.clone(),
+ base_path: app_dir.clone(),
dist: GameDefPlatform::Steam {
src/game/mod.rs
@@ -1,5 +1,5 @@
pub mod ecosystem;
+pub mod error;
pub mod import;
pub mod proc;
pub mod registry;
-pub mod error;
0 commit comments