[fractal/fractal-next] clippy: Stop unnecessary referencing



commit c85ac6d191d9d50016b341534201069def789ddc
Author: Kai A. Hiller <V02460 gmail com>
Date:   Fri Aug 13 16:50:04 2021 +0200

    clippy: Stop unnecessary referencing

 src/error.rs                                    |  8 +++----
 src/login.rs                                    | 12 +++++------
 src/session/content/explore/public_room.rs      |  2 +-
 src/session/content/explore/public_room_list.rs |  4 ++--
 src/session/content/explore/public_room_row.rs  | 10 ++++-----
 src/session/content/invite.rs                   |  4 ++--
 src/session/content/item_row.rs                 |  4 ++--
 src/session/content/message_row.rs              | 20 +++++++++---------
 src/session/room/event.rs                       | 28 ++++++++++++-------------
 src/session/room/item.rs                        | 18 ++++++++--------
 src/session/room/room.rs                        | 14 ++++++-------
 src/session/room_list.rs                        | 28 ++++++++++++-------------
 src/session/sidebar/category_row.rs             |  8 +++----
 src/session/sidebar/entry_row.rs                |  4 ++--
 src/session/sidebar/item_list.rs                |  2 +-
 src/session/sidebar/room_row.rs                 |  6 +++---
 src/session/sidebar/row.rs                      |  4 ++--
 src/session/user.rs                             | 16 +++++++-------
 18 files changed, 96 insertions(+), 96 deletions(-)
---
diff --git a/src/error.rs b/src/error.rs
index f56e2c56..c3a94f03 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -39,24 +39,24 @@ impl Error {
     }
 
     fn set_matrix_error(&self, error: MatrixError) {
-        let priv_ = imp::Error::from_instance(&self);
+        let priv_ = imp::Error::from_instance(self);
         priv_.matrix_error.set(error).unwrap()
     }
 
     pub fn matrix_error(&self) -> &MatrixError {
-        let priv_ = imp::Error::from_instance(&self);
+        let priv_ = imp::Error::from_instance(self);
         priv_.matrix_error.get().unwrap()
     }
 
     /// Set a function that builds the widget used to display this error in the UI
     pub fn set_widget_builder<F: Fn(&Self) -> Option<gtk::Widget> + 'static>(&self, f: F) {
-        let priv_ = imp::Error::from_instance(&self);
+        let priv_ = imp::Error::from_instance(self);
         priv_.widget_builder.replace(Some(Box::new(f)));
     }
 
     /// Produces a widget via the function set in `Self::set_widget_builder()`
     pub fn widget(&self) -> Option<gtk::Widget> {
-        let priv_ = imp::Error::from_instance(&self);
+        let priv_ = imp::Error::from_instance(self);
         let widget_builder = priv_.widget_builder.borrow();
         let widget_builder = widget_builder.as_ref()?;
         widget_builder(self)
diff --git a/src/login.rs b/src/login.rs
index d8be5274..85900483 100644
--- a/src/login.rs
+++ b/src/login.rs
@@ -98,7 +98,7 @@ impl Login {
     }
 
     fn enable_next_action(&self) {
-        let priv_ = imp::Login::from_instance(&self);
+        let priv_ = imp::Login::from_instance(self);
         let homeserver = priv_.homeserver_entry.text();
         let username = priv_.username_entry.text_length();
         let password = priv_.password_entry.text().len();
@@ -117,7 +117,7 @@ impl Login {
     }
 
     fn login(&self) {
-        let priv_ = imp::Login::from_instance(&self);
+        let priv_ = imp::Login::from_instance(self);
         let homeserver = priv_.homeserver_entry.text().to_string();
         let username = priv_.username_entry.text().to_string();
         let password = priv_.password_entry.text().to_string();
@@ -136,7 +136,7 @@ impl Login {
     }
 
     fn clean(&self) {
-        let priv_ = imp::Login::from_instance(&self);
+        let priv_ = imp::Login::from_instance(self);
         priv_.homeserver_entry.set_text("");
         priv_.username_entry.set_text("");
         priv_.password_entry.set_text("");
@@ -144,7 +144,7 @@ impl Login {
     }
 
     fn freeze(&self) {
-        let priv_ = imp::Login::from_instance(&self);
+        let priv_ = imp::Login::from_instance(self);
 
         self.action_set_enabled("login.next", false);
         priv_
@@ -154,7 +154,7 @@ impl Login {
     }
 
     fn unfreeze(&self) {
-        let priv_ = imp::Login::from_instance(&self);
+        let priv_ = imp::Login::from_instance(self);
 
         self.action_set_enabled("login.next", true);
         priv_.next_stack.set_visible_child(&priv_.next_label.get());
@@ -177,7 +177,7 @@ impl Login {
     }
 
     pub fn default_widget(&self) -> gtk::Widget {
-        imp::Login::from_instance(&self).next_button.get().upcast()
+        imp::Login::from_instance(self).next_button.get().upcast()
     }
 
     pub fn set_handler_for_prepared_session(&self, session: &Session) {
diff --git a/src/session/content/explore/public_room.rs b/src/session/content/explore/public_room.rs
index a7cee821..90e63066 100644
--- a/src/session/content/explore/public_room.rs
+++ b/src/session/content/explore/public_room.rs
@@ -121,7 +121,7 @@ impl PublicRoom {
     }
 
     pub fn session(&self) -> &Session {
-        let priv_ = imp::PublicRoom::from_instance(&self);
+        let priv_ = imp::PublicRoom::from_instance(self);
         priv_.session.get().unwrap()
     }
 
diff --git a/src/session/content/explore/public_room_list.rs b/src/session/content/explore/public_room_list.rs
index f285d1ec..e94243de 100644
--- a/src/session/content/explore/public_room_list.rs
+++ b/src/session/content/explore/public_room_list.rs
@@ -174,7 +174,7 @@ impl PublicRoomList {
         server: Option<String>,
         network: Option<String>,
     ) {
-        let priv_ = imp::PublicRoomList::from_instance(&self);
+        let priv_ = imp::PublicRoomList::from_instance(self);
 
         if priv_.search_term.borrow().as_ref() == search_term.as_ref()
             && priv_.server.borrow().as_ref() == server.as_ref()
@@ -190,7 +190,7 @@ impl PublicRoomList {
     }
 
     fn handle_public_rooms_response(&self, response: PublicRoomsResponse) {
-        let priv_ = imp::PublicRoomList::from_instance(&self);
+        let priv_ = imp::PublicRoomList::from_instance(self);
         let session = &self.session().unwrap();
 
         priv_.next_batch.replace(response.next_batch.to_owned());
diff --git a/src/session/content/explore/public_room_row.rs b/src/session/content/explore/public_room_row.rs
index ee2c2cf5..7cb7fd90 100644
--- a/src/session/content/explore/public_room_row.rs
+++ b/src/session/content/explore/public_room_row.rs
@@ -119,12 +119,12 @@ impl PublicRoomRow {
     }
 
     pub fn public_room(&self) -> Option<PublicRoom> {
-        let priv_ = imp::PublicRoomRow::from_instance(&self);
+        let priv_ = imp::PublicRoomRow::from_instance(self);
         priv_.public_room.borrow().clone()
     }
 
     pub fn set_public_room(&self, public_room: Option<PublicRoom>) {
-        let priv_ = imp::PublicRoomRow::from_instance(&self);
+        let priv_ = imp::PublicRoomRow::from_instance(self);
         let old_public_room = self.public_room();
 
         if old_public_room == public_room {
@@ -168,8 +168,8 @@ impl PublicRoomRow {
                 let has_alias = if let Some(ref alias) = matrix_public_room.canonical_alias {
                     priv_.alias.set_text(alias.as_str());
                     true
-                } else if let Some(ref alias) = matrix_public_room.aliases.get(0) {
-                    priv_.alias.set_text(&alias.as_str());
+                } else if let Some(alias) = matrix_public_room.aliases.get(0) {
+                    priv_.alias.set_text(alias.as_str());
                     true
                 } else {
                     false
@@ -217,7 +217,7 @@ impl PublicRoomRow {
     }
 
     fn update_button(&self, public_room: &PublicRoom) {
-        let priv_ = imp::PublicRoomRow::from_instance(&self);
+        let priv_ = imp::PublicRoomRow::from_instance(self);
         if public_room.room().is_some() {
             priv_.button.set_label(&gettext("View"));
         } else {
diff --git a/src/session/content/invite.rs b/src/session/content/invite.rs
index b2ee055e..76078807 100644
--- a/src/session/content/invite.rs
+++ b/src/session/content/invite.rs
@@ -172,8 +172,8 @@ impl Invite {
                 clone!(@weak self as obj => move |room, _| {
                         if room.category() != RoomType::Invited {
                                 let priv_ = imp::Invite::from_instance(&obj);
-                                priv_.reject_requests.borrow_mut().remove(&room);
-                                priv_.accept_requests.borrow_mut().remove(&room);
+                                priv_.reject_requests.borrow_mut().remove(room);
+                                priv_.accept_requests.borrow_mut().remove(room);
                                 obj.reset();
                                 if let Some(category_handler) = priv_.category_handler.take() {
                                     room.disconnect(category_handler);
diff --git a/src/session/content/item_row.rs b/src/session/content/item_row.rs
index b5abc0fd..9b1b5c8b 100644
--- a/src/session/content/item_row.rs
+++ b/src/session/content/item_row.rs
@@ -106,7 +106,7 @@ impl ItemRow {
 
     /// Get the row's `Item`.
     pub fn item(&self) -> Option<Item> {
-        let priv_ = imp::ItemRow::from_instance(&self);
+        let priv_ = imp::ItemRow::from_instance(self);
         priv_.item.borrow().clone()
     }
 
@@ -123,7 +123,7 @@ impl ItemRow {
     /// It tries to reuse the widget and only update the content whenever possible, but it will
     /// create a new widget and drop the old one if it has to.
     fn set_item(&self, item: Option<Item>) {
-        let priv_ = imp::ItemRow::from_instance(&self);
+        let priv_ = imp::ItemRow::from_instance(self);
 
         if let Some(ItemType::Event(event)) = priv_.item.borrow().as_ref().map(|item| item.type_())
         {
diff --git a/src/session/content/message_row.rs b/src/session/content/message_row.rs
index 2b098675..ffe2db39 100644
--- a/src/session/content/message_row.rs
+++ b/src/session/content/message_row.rs
@@ -180,7 +180,7 @@ impl MessageRow {
             .relates_to_changed_handler
             .replace(Some(event.connect_relates_to_changed(
                 clone!(@weak self as obj => move |event| {
-                    obj.update_content(&event);
+                    obj.update_content(event);
                 }),
             )));
         self.update_content(&event);
@@ -320,9 +320,9 @@ impl MessageRow {
     fn show_label_with_text(&self, text: &str) {
         let priv_ = imp::MessageRow::from_instance(self);
         if let Some(Ok(child)) = priv_.content.child().map(|w| w.downcast::<gtk::Label>()) {
-            child.set_text(&text);
+            child.set_text(text);
         } else {
-            let child = gtk::Label::new(Some(&text));
+            let child = gtk::Label::new(Some(text));
             set_label_styles(&child);
             priv_.content.set_child(Some(&child));
         }
@@ -331,10 +331,10 @@ impl MessageRow {
     fn show_label_with_markup(&self, text: &str) {
         let priv_ = imp::MessageRow::from_instance(self);
         if let Some(Ok(child)) = priv_.content.child().map(|w| w.downcast::<gtk::Label>()) {
-            child.set_markup(&text);
+            child.set_markup(text);
         } else {
             let child = gtk::Label::new(None);
-            child.set_markup(&text);
+            child.set_markup(text);
             set_label_styles(&child);
             priv_.content.set_child(Some(&child));
         }
@@ -375,7 +375,7 @@ fn create_widget_for_html_block(block: &HtmlBlock) -> gtk::Widget {
         HtmlBlock::Heading(n, s) => {
             let w = gtk::Label::new(None);
             set_label_styles(&w);
-            w.set_markup(&s);
+            w.set_markup(s);
             w.add_css_class(&format!("h{}", n));
             w.upcast::<gtk::Widget>()
         }
@@ -392,7 +392,7 @@ fn create_widget_for_html_block(block: &HtmlBlock) -> gtk::Widget {
                 set_label_styles(&w);
                 h_box.append(&bullet);
                 h_box.append(&w);
-                w.set_markup(&li);
+                w.set_markup(li);
                 bx.append(&h_box);
             }
 
@@ -411,7 +411,7 @@ fn create_widget_for_html_block(block: &HtmlBlock) -> gtk::Widget {
                 set_label_styles(&w);
                 h_box.append(&bullet);
                 h_box.append(&w);
-                w.set_markup(&ol);
+                w.set_markup(ol);
                 bx.append(&h_box);
             }
 
@@ -422,7 +422,7 @@ fn create_widget_for_html_block(block: &HtmlBlock) -> gtk::Widget {
             scrolled.set_policy(gtk::PolicyType::Automatic, gtk::PolicyType::Never);
             let buffer = sourceview::Buffer::new(None);
             buffer.set_highlight_matching_brackets(false);
-            buffer.set_text(&s);
+            buffer.set_text(s);
             let view = sourceview::View::with_buffer(&buffer);
             view.set_editable(false);
             view.add_css_class("codeview");
@@ -441,7 +441,7 @@ fn create_widget_for_html_block(block: &HtmlBlock) -> gtk::Widget {
         HtmlBlock::Text(s) => {
             let w = gtk::Label::new(None);
             set_label_styles(&w);
-            w.set_markup(&s);
+            w.set_markup(s);
             w.upcast::<gtk::Widget>()
         }
     }
diff --git a/src/session/room/event.rs b/src/session/room/event.rs
index 9bcf19b3..2be1fd26 100644
--- a/src/session/room/event.rs
+++ b/src/session/room/event.rs
@@ -161,7 +161,7 @@ impl Event {
     }
 
     pub fn sender(&self) -> User {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
         priv_
             .room
             .get()
@@ -173,17 +173,17 @@ impl Event {
     ///
     /// If the `SyncRoomEvent` couldn't be deserialized this is `None`
     pub fn matrix_event(&self) -> Option<AnySyncRoomEvent> {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
         priv_.event.borrow().clone()
     }
 
     pub fn matrix_pure_event(&self) -> SyncRoomEvent {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
         priv_.pure_event.borrow().clone().unwrap()
     }
 
     pub fn set_matrix_pure_event(&self, event: SyncRoomEvent) {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
 
         if let Ok(deserialized) = event.event.deserialize() {
             priv_.event.replace(Some(deserialized));
@@ -197,7 +197,7 @@ impl Event {
     }
 
     pub fn matrix_sender(&self) -> UserId {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
 
         if let Some(event) = priv_.event.borrow().as_ref() {
             event.sender().to_owned()
@@ -215,7 +215,7 @@ impl Event {
     }
 
     pub fn matrix_event_id(&self) -> EventId {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
 
         if let Some(event) = priv_.event.borrow().as_ref() {
             event.event_id().to_owned()
@@ -233,13 +233,13 @@ impl Event {
     }
 
     pub fn source(&self) -> String {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
         serde_json::to_string_pretty(priv_.pure_event.borrow().as_ref().unwrap().event.json())
             .unwrap()
     }
 
     pub fn timestamp(&self) -> DateTime {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
 
         let ts = if let Some(event) = priv_.event.borrow().as_ref() {
             event.origin_server_ts().as_secs()
@@ -278,7 +278,7 @@ impl Event {
 
     /// Find the related event if any
     pub fn related_matrix_event(&self) -> Option<EventId> {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
 
         match priv_.event.borrow().as_ref()? {
             AnySyncRoomEvent::Message(ref message) => match message {
@@ -305,7 +305,7 @@ impl Event {
 
     /// Whether this event is hidden from the user or displayed in the room history.
     pub fn is_hidden_event(&self) -> bool {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
 
         if self.related_matrix_event().is_some() {
             return true;
@@ -388,7 +388,7 @@ impl Event {
     }
 
     pub fn set_show_header(&self, visible: bool) {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
         if priv_.show_header.get() == visible {
             return;
         }
@@ -397,7 +397,7 @@ impl Event {
     }
 
     pub fn show_header(&self) -> bool {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
 
         priv_.show_header.get()
     }
@@ -427,13 +427,13 @@ impl Event {
     }
 
     pub fn add_relates_to(&self, events: Vec<Event>) {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
         priv_.relates_to.borrow_mut().extend(events);
         self.emit_by_name("relates-to-changed", &[]).unwrap();
     }
 
     pub fn relates_to(&self) -> Vec<Event> {
-        let priv_ = imp::Event::from_instance(&self);
+        let priv_ = imp::Event::from_instance(self);
         priv_.relates_to.borrow().clone()
     }
 
diff --git a/src/session/room/item.rs b/src/session/room/item.rs
index eefa8e31..69c125ef 100644
--- a/src/session/room/item.rs
+++ b/src/session/room/item.rs
@@ -138,7 +138,7 @@ impl Item {
     }
 
     pub fn matrix_event(&self) -> Option<AnySyncRoomEvent> {
-        let priv_ = imp::Item::from_instance(&self);
+        let priv_ = imp::Item::from_instance(self);
         if let ItemType::Event(event) = priv_.type_.get().unwrap() {
             event.matrix_event()
         } else {
@@ -147,7 +147,7 @@ impl Item {
     }
 
     pub fn event(&self) -> Option<&Event> {
-        let priv_ = imp::Item::from_instance(&self);
+        let priv_ = imp::Item::from_instance(self);
         if let ItemType::Event(event) = priv_.type_.get().unwrap() {
             Some(event)
         } else {
@@ -156,7 +156,7 @@ impl Item {
     }
 
     pub fn matrix_sender(&self) -> Option<UserId> {
-        let priv_ = imp::Item::from_instance(&self);
+        let priv_ = imp::Item::from_instance(self);
         if let ItemType::Event(event) = priv_.type_.get().unwrap() {
             Some(event.matrix_sender())
         } else {
@@ -165,7 +165,7 @@ impl Item {
     }
 
     pub fn matrix_event_id(&self) -> Option<EventId> {
-        let priv_ = imp::Item::from_instance(&self);
+        let priv_ = imp::Item::from_instance(self);
 
         if let ItemType::Event(event) = priv_.type_.get().unwrap() {
             Some(event.matrix_event_id())
@@ -175,7 +175,7 @@ impl Item {
     }
 
     pub fn event_timestamp(&self) -> Option<DateTime> {
-        let priv_ = imp::Item::from_instance(&self);
+        let priv_ = imp::Item::from_instance(self);
 
         if let ItemType::Event(event) = priv_.type_.get().unwrap() {
             Some(event.timestamp())
@@ -185,7 +185,7 @@ impl Item {
     }
 
     pub fn set_show_header(&self, visible: bool) {
-        let priv_ = imp::Item::from_instance(&self);
+        let priv_ = imp::Item::from_instance(self);
         if self.show_header() == visible {
             return;
         }
@@ -198,7 +198,7 @@ impl Item {
     }
 
     pub fn show_header(&self) -> bool {
-        let priv_ = imp::Item::from_instance(&self);
+        let priv_ = imp::Item::from_instance(self);
 
         if let ItemType::Event(event) = priv_.type_.get().unwrap() {
             event.show_header()
@@ -208,7 +208,7 @@ impl Item {
     }
 
     pub fn can_hide_header(&self) -> bool {
-        let priv_ = imp::Item::from_instance(&self);
+        let priv_ = imp::Item::from_instance(self);
 
         if let ItemType::Event(event) = priv_.type_.get().unwrap() {
             event.can_hide_header()
@@ -218,7 +218,7 @@ impl Item {
     }
 
     pub fn type_(&self) -> &ItemType {
-        let priv_ = imp::Item::from_instance(&self);
+        let priv_ = imp::Item::from_instance(self);
         priv_.type_.get().unwrap()
     }
 
diff --git a/src/session/room/room.rs b/src/session/room/room.rs
index 430ac110..ba59fb3e 100644
--- a/src/session/room/room.rs
+++ b/src/session/room/room.rs
@@ -230,7 +230,7 @@ impl Room {
     }
 
     pub fn session(&self) -> &Session {
-        let priv_ = imp::Room::from_instance(&self);
+        let priv_ = imp::Room::from_instance(self);
         priv_.session.get().unwrap()
     }
 
@@ -427,7 +427,7 @@ impl Room {
     }
 
     pub fn highlight(&self) -> HighlightFlags {
-        let priv_ = imp::Room::from_instance(&self);
+        let priv_ = imp::Room::from_instance(self);
         let count = priv_
             .matrix_room
             .borrow()
@@ -445,13 +445,13 @@ impl Room {
     }
 
     pub fn display_name(&self) -> String {
-        let priv_ = imp::Room::from_instance(&self);
+        let priv_ = imp::Room::from_instance(self);
         let display_name = priv_.name.borrow().clone();
         display_name.unwrap_or_else(|| gettext("Unknown"))
     }
 
     fn set_display_name(&self, display_name: Option<String>) {
-        let priv_ = imp::Room::from_instance(&self);
+        let priv_ = imp::Room::from_instance(self);
 
         if Some(self.display_name()) == display_name {
             return;
@@ -477,7 +477,7 @@ impl Room {
     }
 
     pub fn avatar(&self) -> &Avatar {
-        let priv_ = imp::Room::from_instance(&self);
+        let priv_ = imp::Room::from_instance(self);
         priv_.avatar.get().unwrap()
     }
 
@@ -488,7 +488,7 @@ impl Room {
     }
 
     pub fn inviter(&self) -> Option<User> {
-        let priv_ = imp::Room::from_instance(&self);
+        let priv_ = imp::Room::from_instance(self);
         priv_.inviter.borrow().clone()
     }
 
@@ -501,7 +501,7 @@ impl Room {
 
         room_members
             .entry(user_id.clone())
-            .or_insert_with(|| User::new(self.session(), &user_id))
+            .or_insert_with(|| User::new(self.session(), user_id))
             .clone()
     }
 
diff --git a/src/session/room_list.rs b/src/session/room_list.rs
index fa13c6a0..3178b6e4 100644
--- a/src/session/room_list.rs
+++ b/src/session/room_list.rs
@@ -121,29 +121,29 @@ impl RoomList {
     }
 
     pub fn session(&self) -> &Session {
-        let priv_ = imp::RoomList::from_instance(&self);
+        let priv_ = imp::RoomList::from_instance(self);
         priv_.session.get().unwrap()
     }
 
     pub fn is_pending_room(&self, identifier: &RoomIdOrAliasId) -> bool {
-        let priv_ = imp::RoomList::from_instance(&self);
+        let priv_ = imp::RoomList::from_instance(self);
         priv_.pending_rooms.borrow().contains(identifier)
     }
 
     fn pending_rooms_remove(&self, identifier: &RoomIdOrAliasId) {
-        let priv_ = imp::RoomList::from_instance(&self);
+        let priv_ = imp::RoomList::from_instance(self);
         priv_.pending_rooms.borrow_mut().remove(identifier);
         self.emit_by_name("pending-rooms-changed", &[]).unwrap();
     }
 
     fn pending_rooms_insert(&self, identifier: RoomIdOrAliasId) {
-        let priv_ = imp::RoomList::from_instance(&self);
+        let priv_ = imp::RoomList::from_instance(self);
         priv_.pending_rooms.borrow_mut().insert(identifier);
         self.emit_by_name("pending-rooms-changed", &[]).unwrap();
     }
 
     fn pending_rooms_replace_or_remove(&self, identifier: &RoomIdOrAliasId, room_id: RoomId) {
-        let priv_ = imp::RoomList::from_instance(&self);
+        let priv_ = imp::RoomList::from_instance(self);
         {
             let mut pending_rooms = priv_.pending_rooms.borrow_mut();
             pending_rooms.remove(identifier);
@@ -155,13 +155,13 @@ impl RoomList {
     }
 
     pub fn get(&self, room_id: &RoomId) -> Option<Room> {
-        let priv_ = imp::RoomList::from_instance(&self);
+        let priv_ = imp::RoomList::from_instance(self);
         priv_.list.borrow().get(room_id).cloned()
     }
 
     /// Waits till the Room becomes available
     pub async fn get_wait(&self, room_id: RoomId) -> Option<Room> {
-        let priv_ = imp::RoomList::from_instance(&self);
+        let priv_ = imp::RoomList::from_instance(self);
         if let Some(room) = priv_.list.borrow().get(&room_id) {
             Some(room.clone())
         } else {
@@ -184,7 +184,7 @@ impl RoomList {
     }
 
     fn get_full(&self, room_id: &RoomId) -> Option<(usize, RoomId, Room)> {
-        let priv_ = imp::RoomList::from_instance(&self);
+        let priv_ = imp::RoomList::from_instance(self);
         priv_
             .list
             .borrow()
@@ -193,12 +193,12 @@ impl RoomList {
     }
 
     pub fn contains_key(&self, room_id: &RoomId) -> bool {
-        let priv_ = imp::RoomList::from_instance(&self);
+        let priv_ = imp::RoomList::from_instance(self);
         priv_.list.borrow().contains_key(room_id)
     }
 
     pub fn remove(&self, room_id: &RoomId) {
-        let priv_ = imp::RoomList::from_instance(&self);
+        let priv_ = imp::RoomList::from_instance(self);
 
         let removed = {
             let mut list = priv_.list.borrow_mut();
@@ -212,7 +212,7 @@ impl RoomList {
     }
 
     fn items_added(&self, added: usize) {
-        let priv_ = imp::RoomList::from_instance(&self);
+        let priv_ = imp::RoomList::from_instance(self);
 
         let list = priv_.list.borrow();
 
@@ -222,7 +222,7 @@ impl RoomList {
             room.connect_notify_local(
                 Some("category"),
                 clone!(@weak self as obj => move |r, _| {
-                    if let Some((position, _, _)) = obj.get_full(&r.room_id()) {
+                    if let Some((position, _, _)) = obj.get_full(r.room_id()) {
                         obj.items_changed(position as u32, 1, 1);
                     }
                 }),
@@ -237,7 +237,7 @@ impl RoomList {
     /// Note that the `Store` currently doesn't store all events, therefore, we aren't really
     /// loading much via this function.
     pub fn load(&self) {
-        let priv_ = imp::RoomList::from_instance(&self);
+        let priv_ = imp::RoomList::from_instance(self);
         let session = self.session();
         let client = session.client();
         let matrix_rooms = client.rooms();
@@ -258,7 +258,7 @@ impl RoomList {
     }
 
     pub fn handle_response_rooms(&self, rooms: ResponseRooms) {
-        let priv_ = imp::RoomList::from_instance(&self);
+        let priv_ = imp::RoomList::from_instance(self);
         let session = self.session();
 
         let mut added = 0;
diff --git a/src/session/sidebar/category_row.rs b/src/session/sidebar/category_row.rs
index faa3c349..07da94a2 100644
--- a/src/session/sidebar/category_row.rs
+++ b/src/session/sidebar/category_row.rs
@@ -104,12 +104,12 @@ impl CategoryRow {
     }
 
     pub fn category(&self) -> Option<Category> {
-        let priv_ = imp::CategoryRow::from_instance(&self);
+        let priv_ = imp::CategoryRow::from_instance(self);
         priv_.category.borrow().clone()
     }
 
     pub fn set_category(&self, category: Option<Category>) {
-        let priv_ = imp::CategoryRow::from_instance(&self);
+        let priv_ = imp::CategoryRow::from_instance(self);
 
         if self.category() == category {
             return;
@@ -134,12 +134,12 @@ impl CategoryRow {
     }
 
     fn expanded(&self) -> bool {
-        let priv_ = imp::CategoryRow::from_instance(&self);
+        let priv_ = imp::CategoryRow::from_instance(self);
         priv_.expanded.get()
     }
 
     fn set_expanded(&self, expanded: bool) {
-        let priv_ = imp::CategoryRow::from_instance(&self);
+        let priv_ = imp::CategoryRow::from_instance(self);
 
         if self.expanded() == expanded {
             return;
diff --git a/src/session/sidebar/entry_row.rs b/src/session/sidebar/entry_row.rs
index 093eb698..935c4427 100644
--- a/src/session/sidebar/entry_row.rs
+++ b/src/session/sidebar/entry_row.rs
@@ -83,12 +83,12 @@ impl EntryRow {
     }
 
     pub fn entry(&self) -> Option<Entry> {
-        let priv_ = imp::EntryRow::from_instance(&self);
+        let priv_ = imp::EntryRow::from_instance(self);
         priv_.entry.borrow().clone()
     }
 
     pub fn set_entry(&self, entry: Option<Entry>) {
-        let priv_ = imp::EntryRow::from_instance(&self);
+        let priv_ = imp::EntryRow::from_instance(self);
 
         if self.entry() == entry {
             return;
diff --git a/src/session/sidebar/item_list.rs b/src/session/sidebar/item_list.rs
index edcd748b..b8b1be5d 100644
--- a/src/session/sidebar/item_list.rs
+++ b/src/session/sidebar/item_list.rs
@@ -65,7 +65,7 @@ impl ItemList {
     }
 
     pub fn set_room_list(&self, room_list: &RoomList) {
-        let priv_ = imp::ItemList::from_instance(&self);
+        let priv_ = imp::ItemList::from_instance(self);
 
         priv_
             .list
diff --git a/src/session/sidebar/room_row.rs b/src/session/sidebar/room_row.rs
index 7283926c..a8234300 100644
--- a/src/session/sidebar/room_row.rs
+++ b/src/session/sidebar/room_row.rs
@@ -94,12 +94,12 @@ impl RoomRow {
     }
 
     pub fn room(&self) -> Option<Room> {
-        let priv_ = imp::RoomRow::from_instance(&self);
+        let priv_ = imp::RoomRow::from_instance(self);
         priv_.room.borrow().clone()
     }
 
     pub fn set_room(&self, room: Option<Room>) {
-        let priv_ = imp::RoomRow::from_instance(&self);
+        let priv_ = imp::RoomRow::from_instance(self);
 
         if self.room() == room {
             return;
@@ -166,7 +166,7 @@ impl RoomRow {
     }
 
     fn set_highlight(&self) {
-        let priv_ = imp::RoomRow::from_instance(&self);
+        let priv_ = imp::RoomRow::from_instance(self);
         if let Some(room) = &*priv_.room.borrow() {
             match room.highlight() {
                 HighlightFlags::NONE => {
diff --git a/src/session/sidebar/row.rs b/src/session/sidebar/row.rs
index c9d57d33..d819826e 100644
--- a/src/session/sidebar/row.rs
+++ b/src/session/sidebar/row.rs
@@ -92,12 +92,12 @@ impl Row {
     }
 
     pub fn list_row(&self) -> Option<gtk::TreeListRow> {
-        let priv_ = imp::Row::from_instance(&self);
+        let priv_ = imp::Row::from_instance(self);
         priv_.list_row.borrow().clone()
     }
 
     pub fn set_list_row(&self, list_row: Option<gtk::TreeListRow>) {
-        let priv_ = imp::Row::from_instance(&self);
+        let priv_ = imp::Row::from_instance(self);
 
         if self.list_row() == list_row {
             return;
diff --git a/src/session/user.rs b/src/session/user.rs
index cee37ed3..389f991b 100644
--- a/src/session/user.rs
+++ b/src/session/user.rs
@@ -122,17 +122,17 @@ impl User {
     }
 
     pub fn session(&self) -> &Session {
-        let priv_ = imp::User::from_instance(&self);
+        let priv_ = imp::User::from_instance(self);
         priv_.session.get().unwrap()
     }
 
     pub fn user_id(&self) -> &UserId {
-        let priv_ = imp::User::from_instance(&self);
+        let priv_ = imp::User::from_instance(self);
         priv_.user_id.get().unwrap()
     }
 
     pub fn display_name(&self) -> String {
-        let priv_ = imp::User::from_instance(&self);
+        let priv_ = imp::User::from_instance(self);
 
         if let Some(display_name) = priv_.display_name.borrow().to_owned() {
             display_name
@@ -142,13 +142,13 @@ impl User {
     }
 
     pub fn set_display_name(&self, display_name: Option<String>) {
-        let priv_ = imp::User::from_instance(&self);
+        let priv_ = imp::User::from_instance(self);
         priv_.display_name.replace(display_name);
         self.notify("display-name");
     }
 
     pub fn avatar(&self) -> &Avatar {
-        let priv_ = imp::User::from_instance(&self);
+        let priv_ = imp::User::from_instance(self);
         priv_.avatar.get().unwrap()
     }
 
@@ -158,7 +158,7 @@ impl User {
 
     /// Update the user based on the the room member state event
     pub fn update_from_room_member(&self, member: &RoomMember) {
-        let priv_ = imp::User::from_instance(&self);
+        let priv_ = imp::User::from_instance(self);
 
         let user_id = priv_.user_id.get().unwrap();
         if member.user_id().as_str() != user_id {
@@ -176,7 +176,7 @@ impl User {
 
     /// Update the user based on the the room member state event
     pub fn update_from_member_event(&self, event: &SyncStateEvent<MemberEventContent>) {
-        let priv_ = imp::User::from_instance(&self);
+        let priv_ = imp::User::from_instance(self);
         let user_id = priv_.user_id.get().unwrap();
         if event.sender.as_str() != user_id {
             return;
@@ -205,7 +205,7 @@ impl User {
         event: &StrippedStateEvent<MemberEventContent>,
     ) {
         let changed = {
-            let priv_ = imp::User::from_instance(&self);
+            let priv_ = imp::User::from_instance(self);
             let user_id = priv_.user_id.get().unwrap();
             if event.sender.as_str() != user_id {
                 return;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]