diff --git a/fractal-gtk/src/widgets/members_list.rs b/fractal-gtk/src/widgets/members_list.rs index e6f9933d..9a885bcd 100644 --- a/fractal-gtk/src/widgets/members_list.rs +++ b/fractal-gtk/src/widgets/members_list.rs @@ -1,8 +1,6 @@ use glib::clone; use matrix_sdk::identifiers::UserId; -use std::cell::RefCell; -use std::collections::hash_map::HashMap; -use std::rc::Rc; +use std::{cell::RefCell, collections::hash_map::HashMap}; use glib::signal; use gtk::prelude::*; @@ -69,12 +67,11 @@ impl MembersList { Some(w.get_text().to_string()), ); }); - /* we need to remove the handler when the member list is destroyed */ - let id: Rc>> = Rc::new(RefCell::new(Some(id))); + // We need to remove the handler when the member list is destroyed + let id = RefCell::new(Some(id)); let search_entry = self.search_entry.clone(); self.container.connect_destroy(move |_| { - let id = id.borrow_mut().take(); - if let Some(id) = id { + if let Some(id) = id.borrow_mut().take() { signal::signal_handler_disconnect(&search_entry, id); } });