From f037898e1ed7a351c5af2e828877284b3a77f977 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sun, 29 Oct 2023 20:41:11 +0100 Subject: [PATCH] Record widget: remove record type getter --- src/ui/edit_record/record_widget.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/edit_record/record_widget.rs b/src/ui/edit_record/record_widget.rs index b5b8dc1..7c40d6b 100644 --- a/src/ui/edit_record/record_widget.rs +++ b/src/ui/edit_record/record_widget.rs @@ -102,12 +102,13 @@ mod imp { impl WidgetImpl for RecordWidget {} impl RecordWidget { - fn record_type(&self) -> Option<&'static RecordType> { - self.form.borrow().as_ref().map(|form| form.record_type()) - } - fn set_record_type(&self, record_type: &'static RecordType) { - if self.record_type() == Some(record_type) { + if self + .form + .borrow() + .as_ref() + .map_or(false, |form| form.record_type() == record_type) + { return; }