Moving the unwraping of a variable

Moving the unwraping of the variable "rule" inside the condition instead of the if body, for the migration of the database from version 11 to 12.
merge-requests/413/merge
Paul Beziau 2 years ago
parent d47c1a8ba6
commit a2d8aec1e3

@ -851,8 +851,8 @@ impl KeyValueDatabase {
for transformation in underride_rule_transformation { for transformation in underride_rule_transformation {
let rule = rules_list.underride.get(transformation[0]); let rule = rules_list.underride.get(transformation[0]);
if rule.is_some() { if let Some(rule) = rule {
let mut rule = rule.unwrap().clone(); let mut rule = rule.clone();
rule.rule_id = transformation[1].to_string(); rule.rule_id = transformation[1].to_string();
rules_list.underride.remove(transformation[0]); rules_list.underride.remove(transformation[0]);
rules_list.underride.insert(rule); rules_list.underride.insert(rule);

Loading…
Cancel
Save