Simplify game resolver code and add support for platform specifiers#22
Simplify game resolver code and add support for platform specifiers#22ethangreen-dev merged 3 commits intodevelopfrom
Conversation
| fn construct(self: Box<Self>, base: ImportBase) -> Result<GameData, Error> { | ||
| let subkey = format!("Software\\{}\\", self.ident.replace('.', "\\")); | ||
| let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?; | ||
| pub fn get_gamedist(ident: &str, game_def: &GameDef, overrides: &ImportOverrides) -> Result<Option<ActiveDistribution>, Error> { |
Check failure
Code scanning / clippy
? couldn't convert the error to error::Error Error
| let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?; | ||
| pub fn get_gamedist(ident: &str, game_def: &GameDef, overrides: &ImportOverrides) -> Result<Option<ActiveDistribution>, Error> { | ||
| let subkey = format!("Software\\{}\\", ident.replace('.', "\\")); | ||
| let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?; |
Check failure
Code scanning / clippy
? couldn't convert the error to error::Error Error
| let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?; | ||
| pub fn get_gamedist(ident: &str, game_def: &GameDef, overrides: &ImportOverrides) -> Result<Option<ActiveDistribution>, Error> { | ||
| let subkey = format!("Software\\{}\\", ident.replace('.', "\\")); | ||
| let value = reg::get_value_at(HKey::LocalMachine, &subkey, "Install Dir")?; |
Check failure
Code scanning / clippy
? couldn't convert the error to error::Error Error
| } | ||
| } | ||
| } | ||
| pub fn get_gamedist(ident: &str, game_def: &GameDef, overrides: &ImportOverrides) -> Result<Option<ActiveDistribution>, Error> { |
Check failure
Code scanning / clippy
? couldn't convert the error to error::Error Error
| // I'm going to go for the second option. | ||
| // Attempt to get the path of the EGS /Data directory from the registry. | ||
| let subkey = r#"Software\WOW64Node\Epic Games\EpicGamesLauncher"#; | ||
| let value = reg::get_value_at(HKey::LocalMachine, subkey, "AppDataPath")?; |
Check failure
Code scanning / clippy
? couldn't convert the error to error::Error Error
| .ok_or_else(|| { | ||
| GameError::NotFound(ident.into(), "Gamepass".to_string()) | ||
| })?; | ||
| let game_dir = PathBuf::from(reg::get_value_at(HKey::LocalMachine, &game_root, "Root")?); |
Check failure
Code scanning / clippy
? couldn't convert the error to error::Error Error
| use project::error::ProjectError; | ||
| use project::ProjectKind; | ||
| use ts::error::ApiError; | ||
| use ts::v1::models::ecosystem::GamePlatform; |
Check warning
Code scanning / clippy
unused import: ts::v1::models::ecosystem::GamePlatform Warning
|
|
||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| use crate::error::Error; |
Check warning
Code scanning / clippy
unused import: crate::error::Error Warning
|
|
||
| use crate::error::Error; | ||
| use crate::ts::version::Version; | ||
| use crate::game::ecosystem; |
Check warning
Code scanning / clippy
unused import: crate::game::ecosystem Warning
| use crate::error::Error; | ||
| use crate::ts::version::Version; | ||
| use crate::game::ecosystem; | ||
| use crate::game::error::GameError; |
Check warning
Code scanning / clippy
unused import: crate::game::error::GameError Warning
No description provided.