From 53694506f3f9bc555d95073db534154d4ad3cb4b Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 13 Nov 2024 08:07:32 +0200 Subject: [PATCH] remove duplicated constructions --- src/profile/database.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/profile/database.rs b/src/profile/database.rs index 8e3186ae..50ff119a 100644 --- a/src/profile/database.rs +++ b/src/profile/database.rs @@ -28,21 +28,16 @@ impl Database { pub fn records(&self) -> Vec { let binding = self.connection.read().unwrap(); let tx = binding.unchecked_transaction().unwrap(); - records(&tx).unwrap() } /// Get selected profile record if exist pub fn selected(&self) -> Option
{ - let binding = self.connection.read().unwrap(); - let tx = binding.unchecked_transaction().unwrap(); - - for record in records(&tx).unwrap() { + for record in self.records() { if record.is_active { return Some(record); } } - None } }