[fractal/clippyfixes: 2/7] clippy: redundant clones




commit 8bae3cf92cdd20b97a55d39da416f69c1423ac94
Author: Alexandre Franke <afranke gnome org>
Date:   Fri Oct 23 17:39:50 2020 +0200

    clippy: redundant clones
    
    https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone

 fractal-gtk/src/appop/room.rs       | 2 +-
 fractal-gtk/src/appop/start_chat.rs | 2 +-
 fractal-gtk/src/backend/room.rs     | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/fractal-gtk/src/appop/room.rs b/fractal-gtk/src/appop/room.rs
index 9576dbc4..6c26589c 100644
--- a/fractal-gtk/src/appop/room.rs
+++ b/fractal-gtk/src/appop/room.rs
@@ -393,7 +393,7 @@ impl AppOp {
             room::RoomType::Public
         };
 
-        let name = n.clone();
+        let name = n;
         thread::spawn(move || {
             match room::new_room(
                 login_data.server_url,
diff --git a/fractal-gtk/src/appop/start_chat.rs b/fractal-gtk/src/appop/start_chat.rs
index ea169725..c0c89e53 100644
--- a/fractal-gtk/src/appop/start_chat.rs
+++ b/fractal-gtk/src/appop/start_chat.rs
@@ -16,7 +16,7 @@ impl AppOp {
         let login_data = unwrap_or_unit_return!(self.login_data.clone());
         let user = self.invite_list[0].clone();
 
-        let member = user.0.clone();
+        let member = user.0;
         thread::spawn(move || {
             match room::direct_chat(
                 login_data.server_url,
diff --git a/fractal-gtk/src/backend/room.rs b/fractal-gtk/src/backend/room.rs
index 68d6839a..1f146971 100644
--- a/fractal-gtk/src/backend/room.rs
+++ b/fractal-gtk/src/backend/room.rs
@@ -422,7 +422,7 @@ impl HandleError for JoinRoomError {
             "{}",
             remove_matrix_access_token_if_present(&err_str).unwrap_or(err_str)
         );
-        let error = i18n("Can’t join the room, try again.").to_string();
+        let error = i18n("Can’t join the room, try again.");
         let state = AppState::NoRoom;
         APPOP!(show_error_with_info, (error, info));
         APPOP!(set_state, (state));
@@ -434,7 +434,7 @@ pub fn join_room(
     access_token: AccessToken,
     room_id: RoomIdOrAliasId,
 ) -> Result<RoomId, JoinRoomError> {
-    let room_id_or_alias_id = room_id.clone().into();
+    let room_id_or_alias_id = room_id.into();
 
     let params = JoinRoomParameters {
         access_token,


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