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.
This commit is contained in:
Paul Beziau 2022-11-03 13:12:53 +00:00
parent d47c1a8ba6
commit a2d8aec1e3

View file

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