[fractal] Get rid of "warning: cannot borrow `*self` as mutable"
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal] Get rid of "warning: cannot borrow `*self` as mutable"
- Date: Wed, 6 Nov 2019 07:17:28 +0000 (UTC)
commit 31f177f5c1473b2247a08a24481ac5dd1a73e937
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Oct 31 15:33:04 2019 -0600
Get rid of "warning: cannot borrow `*self` as mutable"
warning: cannot borrow `*self` as mutable because it is also borrowed as immutable
--> fractal-gtk/src/appop/room.rs:137:17
|
136 | if let Some(ref active_room) = self.active_room {
| --------------- immutable borrow occurs here
137 | self.set_active_room_by_id(active_room.clone());
| ^^^^ ----------- immutable borrow later used here
| |
| mutable borrow occurs here
fractal-gtk/src/appop/room.rs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/fractal-gtk/src/appop/room.rs b/fractal-gtk/src/appop/room.rs
index 18a71618..60bde306 100644
--- a/fractal-gtk/src/appop/room.rs
+++ b/fractal-gtk/src/appop/room.rs
@@ -132,9 +132,10 @@ impl AppOp {
))
.unwrap();
});
+
// Select active room in the sidebar
- if let Some(ref active_room) = self.active_room {
- self.set_active_room_by_id(active_room.clone());
+ if let Some(active_room) = self.active_room.clone() {
+ self.set_active_room_by_id(active_room);
}
self.cache_rooms();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]