Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kb-1000 committed Jul 4, 2024
1 parent 5380ea7 commit 518d968
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/forge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ fn process_version(file: &fs::DirEntry, out_base: &Path) -> Result<helix::compon
static ref VERSION_PATTERN: Regex =
Regex::new("^(?:[0-9.]+-forge-|[0-9.]+-Forge)(?P<forge_version>[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());
Expand Down
12 changes: 6 additions & 6 deletions src/mojang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 518d968

Please sign in to comment.