refactored: review findings - style and abstraction cleanup

- drop stale phase planning comments from launch_profile module headers.
 - simplify merge_libraries to HashSet<&str> (no string clones).
 - rewrite coord_key with match_indices (clearer intent).
 - read /proc/sys/kernel/osrelease on linux for mojang_os_version
   instead of shelling out to uname; return empty elsewhere.
 - add comment explaining why is_retryable excludes Parse.
 - shorten the launch_profile::... paths in launch/mod.rs with top-level
   use statements.
 - derive Default on LaunchProfile + nested types so test fixtures use
   ..Default::default() instead of listing every None field.
 - inline account_can_launch at its single call site, delete the helper
   and three tests that exercised trivially-correct one-line logic.
 - extract get_json_with_raw on HttpClient and save_profile_bytes in
   instance::loader; collapses three near-identical fetch_X_profile_with_raw
   helpers and three near-identical 'create dir + write bytes' blocks.
This commit is contained in:
objz committed 2026-05-25 19:05:48 +02:00
1 parent 412e6ff91a
commit 363ada8211
15 files changed
+155 -292

No files matched your search

+3 -14
View File
@@ -115,19 +115,8 @@ mod tests {
fn minimal_profile() -> LaunchProfile {
LaunchProfile {
id: "test".into(),
inherits_from: None,
main_class: Some("net.test.Main".into()),
libraries: Vec::new(),
arguments: None,
minecraft_arguments: None,
asset_index: None,
assets: None,
java_version: None,
downloads: None,
release_time: None,
time: None,
game_arguments: None,
type_: None,
..Default::default()
}
}
@@ -211,7 +200,7 @@ mod tests {
os: Some(OsCondition {
name: Some("osx".into()),
arch: None,
version: None,
..Default::default()
}),
features: None,
}],
@@ -252,7 +241,7 @@ mod tests {
os: Some(OsCondition {
name: Some("linux".into()),
arch: None,
version: None,
..Default::default()
}),
features: None,
}],