From 518d9680daf18aab904853080d057bd061176b36 Mon Sep 17 00:00:00 2001 From: kb1000 Date: Fri, 5 Jul 2024 01:16:54 +0200 Subject: [PATCH] clippy fixes --- src/forge.rs | 6 +++--- src/mojang.rs | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/forge.rs b/src/forge.rs index fbd89c3..a8d3d4f 100644 --- a/src/forge.rs +++ b/src/forge.rs @@ -45,9 +45,9 @@ fn process_version(file: &fs::DirEntry, out_base: &Path) -> Result[0-9.]+)$").unwrap(); } - let mut archive = zip::ZipArchive::new(std::fs::File::open(file.path())?)?; - //let archive = zip::Archive::open_at(file.path())?; - let file = std::io::BufReader::new(archive.by_name("version.json")?); + let mut archive = zip::ZipArchive::new(std::fs::File::open(file.path())?)?; + + let file = std::io::BufReader::new(archive.by_name("version.json")?); let version: mojang::MojangVersion = serde_json::from_reader(file)?; ensure!(version.downloads.is_none()); ensure!(version.asset_index.is_none()); diff --git a/src/mojang.rs b/src/mojang.rs index 381e7bd..5f71c34 100644 --- a/src/mojang.rs +++ b/src/mojang.rs @@ -369,7 +369,7 @@ pub fn process_version( ); let mut traits = BTreeSet::new(); let mut is_lwjgl3 = false; - for mut library in &mut version.libraries { + for library in &mut version.libraries { let mut ignore_rules = false; ensure!( library.rules.len() <= 1 @@ -599,29 +599,29 @@ pub fn process_version( feature = Some(ConditionFeature::Demo); } if let Some(has_custom_resolution) = features.has_custom_resolution { - ensure!(has_custom_resolution && matches!(feature, None)); + ensure!(has_custom_resolution && feature.is_none()); traits.insert(helix::component::Trait::SupportsCustomResolution); feature = Some(ConditionFeature::CustomResolution); } if let Some(has_quick_plays_support) = features.has_quick_plays_support { - ensure!(has_quick_plays_support && matches!(feature, None)); + ensure!(has_quick_plays_support && feature.is_none()); continue; } if let Some(is_quick_play_singleplayer) = features.is_quick_play_singleplayer { - ensure!(is_quick_play_singleplayer && matches!(feature, None)); + ensure!(is_quick_play_singleplayer && feature.is_none()); traits.insert(helix::component::Trait::SupportsQuickPlayWorld); feature = Some(ConditionFeature::QuickPlayWorld); } if let Some(is_quick_play_multiplayer) = features.is_quick_play_multiplayer { - ensure!(is_quick_play_multiplayer && matches!(feature, None)); + ensure!(is_quick_play_multiplayer && feature.is_none()); traits.insert(helix::component::Trait::SupportsQuickPlayServer); feature = Some(ConditionFeature::QuickPlayServer); } if let Some(is_quick_play_realms) = features.is_quick_play_realms { - ensure!(is_quick_play_realms && matches!(feature, None)); + ensure!(is_quick_play_realms && feature.is_none()); continue; } } else {