refactor: fixed warnings

This commit is contained in:
Observer KRypt0n_ 2024-05-08 19:19:37 +02:00
parent d0265192d3
commit 8e657c8692
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
3 changed files with 13 additions and 12 deletions

View file

@ -106,7 +106,7 @@ macro_rules! tr {
use fluent_templates::Loader;
#[allow(unused_unsafe)]
$crate::i18n::LOCALES.lookup(unsafe { &$crate::i18n::LANG }, $id)
$crate::i18n::LOCALES.lookup(unsafe { $crate::i18n::LANG.as_ref() }, $id)
}
};
@ -124,7 +124,7 @@ macro_rules! tr {
)*
#[allow(unused_unsafe)]
$crate::i18n::LOCALES.lookup_complete(unsafe { &$crate::i18n::LANG }, $id, Some(&args))
$crate::i18n::LOCALES.lookup_complete(unsafe { $crate::i18n::LANG.as_ref() }, $id, Some(&args))
}
};
}

View file

@ -344,7 +344,8 @@ impl SimpleAsyncComponent for DefaultPathsApp {
self.game_china = result.join(concat!("Yu", "anS", "hen"));
self.fps_unlocker = result.join("fps-unlocker");
self.components = result.join("components");
self.temp = result.clone();
self.temp.clone_from(&result);
self.launcher = result;
}
@ -435,15 +436,15 @@ impl DefaultPathsApp {
pub fn update_config(&self) -> anyhow::Result<()> {
let mut config = Config::get()?;
config.game.wine.builds = self.runners.clone();
config.game.dxvk.builds = self.dxvks.clone();
config.game.wine.prefix = self.prefix.clone();
config.game.path.global = self.game_global.clone();
config.game.path.china = self.game_china.clone();
config.components.path = self.components.clone();
config.launcher.temp = Some(self.temp.clone());
config.game.wine.builds.clone_from(&self.runners);
config.game.dxvk.builds.clone_from(&self.dxvks);
config.game.wine.prefix.clone_from(&self.prefix);
config.game.path.global.clone_from(&self.game_global);
config.game.path.china.clone_from(&self.game_china);
config.components.path.clone_from(&self.components);
config.game.enhancements.fps_unlocker.path.clone_from(&self.fps_unlocker);
config.game.enhancements.fps_unlocker.path = self.fps_unlocker.clone();
config.launcher.temp = Some(self.temp.clone());
Config::update_raw(config)
}

View file

@ -754,7 +754,7 @@ impl SimpleAsyncComponent for EnhancementsApp {
EnhancementsAppMsg::SetDiscordRpcIcon(index) => {
if let Some(icon) = self.discord_rpc_icons.guard().get(index.current_index()) {
if let Ok(mut config) = Config::get() {
config.launcher.discord_rpc.icon = icon.name.clone();
config.launcher.discord_rpc.icon.clone_from(&icon.name);
Config::update(config);