mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 14:03:42 +02:00
Remove failure package (#166)
* Remove dependency on failure * Update flatpak cargo-lock * Update cargo version * Update release manifest
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
use crate::platform::{Platform, SettingsValidity};
|
||||
|
||||
use super::{
|
||||
get_egs_manifests, get_manifests::EpicGamesManifestsError, EpicGamesLauncherSettings,
|
||||
ManifestItem,
|
||||
};
|
||||
use super::{get_egs_manifests, EpicGamesLauncherSettings, ManifestItem};
|
||||
|
||||
pub struct EpicPlatform {
|
||||
settings: EpicGamesLauncherSettings,
|
||||
@@ -17,7 +14,7 @@ impl EpicPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
impl Platform<ManifestItem, EpicGamesManifestsError> for EpicPlatform {
|
||||
impl Platform<ManifestItem, String> for EpicPlatform {
|
||||
fn enabled(&self) -> bool {
|
||||
self.settings.enabled
|
||||
}
|
||||
@@ -26,7 +23,7 @@ impl Platform<ManifestItem, EpicGamesManifestsError> for EpicPlatform {
|
||||
"EGS"
|
||||
}
|
||||
|
||||
fn get_shortcuts(&self) -> Result<Vec<ManifestItem>, EpicGamesManifestsError> {
|
||||
fn get_shortcuts(&self) -> Result<Vec<ManifestItem>, String> {
|
||||
get_egs_manifests(&self.settings)
|
||||
}
|
||||
|
||||
|
||||
@@ -4,23 +4,9 @@ use std::fs::{DirEntry, File};
|
||||
use std::io::BufReader;
|
||||
use std::path::Path;
|
||||
|
||||
use failure::*;
|
||||
|
||||
#[derive(Debug, Fail)]
|
||||
pub enum EpicGamesManifestsError {
|
||||
#[fail(display = "EpicGamesLauncher not found")]
|
||||
NotFound,
|
||||
|
||||
#[fail(
|
||||
display = "Could not read EpicGamesLauncher manifest directory at {} error: {}",
|
||||
path, error
|
||||
)]
|
||||
ReadDirError { path: String, error: std::io::Error },
|
||||
}
|
||||
|
||||
pub(crate) fn get_egs_manifests(
|
||||
settings: &EpicGamesLauncherSettings,
|
||||
) -> Result<Vec<ManifestItem>, EpicGamesManifestsError> {
|
||||
) -> Result<Vec<ManifestItem>, String> {
|
||||
let locations = crate::egs::get_locations();
|
||||
match locations {
|
||||
Some(locations) => {
|
||||
@@ -83,13 +69,13 @@ pub(crate) fn get_egs_manifests(
|
||||
}
|
||||
Ok(manifests)
|
||||
}
|
||||
Err(err) => Err(EpicGamesManifestsError::ReadDirError {
|
||||
error: err,
|
||||
path: manifest_dir_path.to_string_lossy().to_string(),
|
||||
}),
|
||||
Err(err) => Err(format!(
|
||||
"Could not read dir at: {:?} error: {:?}",
|
||||
manifest_dir_path, err
|
||||
)),
|
||||
}
|
||||
}
|
||||
None => Err(EpicGamesManifestsError::NotFound),
|
||||
None => Err("Manifests not found".to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user