1
0

&* is simply just bad. let deref coercion figure it out

This commit is contained in:
leocth
2022-02-20 22:54:05 +08:00
parent 6b11613b99
commit 596ca8ab4f
7 changed files with 18 additions and 20 deletions

View File

@@ -73,12 +73,12 @@ impl Metadata {
pub async fn fetch() -> Result<Self, DataError> {
let (game, forge, fabric) = futures::future::join3(
daedalus::minecraft::fetch_version_manifest(Some(&*format!(
daedalus::minecraft::fetch_version_manifest(Some(&format!(
"{}/minecraft/v0/manifest.json",
META_URL
))),
daedalus::modded::fetch_manifest(&*format!("{}/forge/v0/manifest.json", META_URL)),
daedalus::modded::fetch_manifest(&*format!("{}/fabric/v0/manifest.json", META_URL)),
daedalus::modded::fetch_manifest(&format!("{}/forge/v0/manifest.json", META_URL)),
daedalus::modded::fetch_manifest(&format!("{}/fabric/v0/manifest.json", META_URL)),
)
.await;

View File

@@ -38,7 +38,7 @@ impl Settings {
if settings_path.exists() {
let settings_data = std::fs::read_to_string(settings_path)
.map(|x| serde_json::from_str::<Settings>(&*x).ok())
.map(|x| serde_json::from_str::<Settings>(&x).ok())
.ok()
.flatten();
@@ -52,7 +52,7 @@ impl Settings {
std::fs::write(
Path::new(LAUNCHER_WORK_DIR).join(SETTINGS_FILE),
&*serde_json::to_string(&new)?,
&serde_json::to_string(&new)?,
)?;
SETTINGS.get_or_init(|| RwLock::new(new));