diff options
| author | 2025-01-22 22:02:22 -0600 | |
|---|---|---|
| committer | 2025-01-22 22:02:22 -0600 | |
| commit | 0352776cde908b440e56c77159a483d277ad8fe1 (patch) | |
| tree | e8cf8b64f2202d455e84ce0eef57a020679e4a53 | |
| parent | finish downloaded jres (diff) | |
fix version resolution
| -rw-r--r-- | src/version.rs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/version.rs b/src/version.rs index 5371669..6354143 100644 --- a/src/version.rs +++ b/src/version.rs @@ -147,16 +147,12 @@ pub struct Arguments { impl Arguments { fn apply_child(&mut self, other: &Arguments) { - if self.game.is_none() { - if let Some(game) = other.game.as_ref() { - self.game.replace(game.to_owned()); - } + if let Some(game) = other.game.as_ref() { + self.game.get_or_insert_default().splice(0..0, game.iter().cloned()); } - if self.jvm.is_none() { - if let Some(jvm) = other.jvm.as_ref() { - self.jvm.replace(jvm.to_owned()); - } + if let Some(jvm) = other.jvm.as_ref() { + self.jvm.get_or_insert_default().splice(0..0, jvm.iter().cloned()); } } } @@ -323,9 +319,7 @@ impl CompleteVersion { if let Some(rules) = other.compatibility_rules.as_ref() { if let Some(my_rules) = self.compatibility_rules.as_mut() { - for rule in rules { - my_rules.push(rule.to_owned()); - } + my_rules.splice(0..0, rules.iter().cloned()); } else { self.compatibility_rules.replace(rules.to_owned()); } |
