diff options
Diffstat (limited to 'src')
| -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()); } |
