From a2d8aec1e3a1578872f1caaee719d3acfa5227bc Mon Sep 17 00:00:00 2001 From: Paul Beziau Date: Thu, 3 Nov 2022 13:12:53 +0000 Subject: [PATCH] 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. --- src/database/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/database/mod.rs b/src/database/mod.rs index ccc81774..f6a76c68 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -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);