[fractal/fractal-next] clippy: Implement Default where possible



commit 44c55b7ab09ce8c4da26017df7771a924f1eef41
Author: Kai A. Hiller <V02460 gmail com>
Date:   Mon Aug 9 15:51:01 2021 +0200

    clippy: Implement Default where possible

 src/components/avatar.rs                       | 6 ++++++
 src/components/context_menu_bin.rs             | 6 ++++++
 src/components/pill.rs                         | 6 ++++++
 src/components/room_title.rs                   | 6 ++++++
 src/components/spinner_button.rs               | 6 ++++++
 src/login.rs                                   | 6 ++++++
 src/session/content/explore/public_room_row.rs | 6 ++++++
 src/session/content/invite.rs                  | 6 ++++++
 src/session/content/item_row.rs                | 6 ++++++
 src/session/content/markdown_popover.rs        | 6 ++++++
 src/session/content/message_row.rs             | 6 ++++++
 src/session/content/room_history.rs            | 6 ++++++
 src/session/content/state_row.rs               | 6 ++++++
 src/session/mod.rs                             | 6 ++++++
 src/session/sidebar/category_row.rs            | 6 ++++++
 src/session/sidebar/entry_row.rs               | 6 ++++++
 src/session/sidebar/room_row.rs                | 6 ++++++
 src/session/sidebar/row.rs                     | 6 ++++++
 src/session/sidebar/sidebar.rs                 | 6 ++++++
 19 files changed, 114 insertions(+)
---
diff --git a/src/components/avatar.rs b/src/components/avatar.rs
index 848bd76b..49e3e90b 100644
--- a/src/components/avatar.rs
+++ b/src/components/avatar.rs
@@ -133,3 +133,9 @@ impl Avatar {
         }
     }
 }
+
+impl Default for Avatar {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/components/context_menu_bin.rs b/src/components/context_menu_bin.rs
index 2bbf06d1..10864e9a 100644
--- a/src/components/context_menu_bin.rs
+++ b/src/components/context_menu_bin.rs
@@ -196,3 +196,9 @@ unsafe impl<T: ContextMenuBinImpl> IsSubclassable<T> for ContextMenuBin {
         <gtk::Widget as IsSubclassable<T>>::instance_init(instance);
     }
 }
+
+impl Default for ContextMenuBin {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/components/pill.rs b/src/components/pill.rs
index 5f3593f0..cd7d8b8f 100644
--- a/src/components/pill.rs
+++ b/src/components/pill.rs
@@ -172,3 +172,9 @@ impl Pill {
         priv_.room.borrow().clone()
     }
 }
+
+impl Default for Pill {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/components/room_title.rs b/src/components/room_title.rs
index 52dce93e..6e1efb53 100644
--- a/src/components/room_title.rs
+++ b/src/components/room_title.rs
@@ -143,3 +143,9 @@ impl RoomTitle {
         priv_.subtitle.borrow().clone()
     }
 }
+
+impl Default for RoomTitle {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/components/spinner_button.rs b/src/components/spinner_button.rs
index 3298a770..6d94833e 100644
--- a/src/components/spinner_button.rs
+++ b/src/components/spinner_button.rs
@@ -138,3 +138,9 @@ impl SpinnerButton {
         priv_.stack.visible_child().as_ref() == Some(priv_.spinner.upcast_ref())
     }
 }
+
+impl Default for SpinnerButton {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/login.rs b/src/login.rs
index 384cd30e..d8be5274 100644
--- a/src/login.rs
+++ b/src/login.rs
@@ -198,6 +198,12 @@ impl Login {
     }
 }
 
+impl Default for Login {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
 fn build_homeserver_url(server: &str) -> Result<Url, ParseError> {
     if server.starts_with("http://";) || server.starts_with("https://";) {
         Url::parse(server)
diff --git a/src/session/content/explore/public_room_row.rs b/src/session/content/explore/public_room_row.rs
index 31ae061e..ee2c2cf5 100644
--- a/src/session/content/explore/public_room_row.rs
+++ b/src/session/content/explore/public_room_row.rs
@@ -227,3 +227,9 @@ impl PublicRoomRow {
         priv_.button.set_loading(public_room.is_pending());
     }
 }
+
+impl Default for PublicRoomRow {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/session/content/invite.rs b/src/session/content/invite.rs
index 64c7e00d..b2ee055e 100644
--- a/src/session/content/invite.rs
+++ b/src/session/content/invite.rs
@@ -248,3 +248,9 @@ impl Invite {
         Some(())
     }
 }
+
+impl Default for Invite {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/session/content/item_row.rs b/src/session/content/item_row.rs
index 1c70d0c0..b5abc0fd 100644
--- a/src/session/content/item_row.rs
+++ b/src/session/content/item_row.rs
@@ -228,3 +228,9 @@ impl ItemRow {
         }
     }
 }
+
+impl Default for ItemRow {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/session/content/markdown_popover.rs b/src/session/content/markdown_popover.rs
index 35b1261f..0dfbfd80 100644
--- a/src/session/content/markdown_popover.rs
+++ b/src/session/content/markdown_popover.rs
@@ -81,3 +81,9 @@ impl MarkdownPopover {
         glib::Object::new(&[]).expect("Failed to create MarkdownPopover")
     }
 }
+
+impl Default for MarkdownPopover {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/session/content/message_row.rs b/src/session/content/message_row.rs
index 996c3b17..2b098675 100644
--- a/src/session/content/message_row.rs
+++ b/src/session/content/message_row.rs
@@ -446,3 +446,9 @@ fn create_widget_for_html_block(block: &HtmlBlock) -> gtk::Widget {
         }
     }
 }
+
+impl Default for MessageRow {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/session/content/room_history.rs b/src/session/content/room_history.rs
index 29b42dad..caa4f5e9 100644
--- a/src/session/content/room_history.rs
+++ b/src/session/content/room_history.rs
@@ -328,3 +328,9 @@ impl RoomHistory {
         }
     }
 }
+
+impl Default for RoomHistory {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/session/content/state_row.rs b/src/session/content/state_row.rs
index f214ba5d..9b047adc 100644
--- a/src/session/content/state_row.rs
+++ b/src/session/content/state_row.rs
@@ -178,3 +178,9 @@ impl StateRow {
         };
     }
 }
+
+impl Default for StateRow {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/session/mod.rs b/src/session/mod.rs
index 20954be5..136b3dae 100644
--- a/src/session/mod.rs
+++ b/src/session/mod.rs
@@ -450,3 +450,9 @@ impl Session {
         self.room_list().handle_response_rooms(response.rooms);
     }
 }
+
+impl Default for Session {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/session/sidebar/category_row.rs b/src/session/sidebar/category_row.rs
index c578be74..faa3c349 100644
--- a/src/session/sidebar/category_row.rs
+++ b/src/session/sidebar/category_row.rs
@@ -155,3 +155,9 @@ impl CategoryRow {
         self.notify("expanded");
     }
 }
+
+impl Default for CategoryRow {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/session/sidebar/entry_row.rs b/src/session/sidebar/entry_row.rs
index b56b1711..093eb698 100644
--- a/src/session/sidebar/entry_row.rs
+++ b/src/session/sidebar/entry_row.rs
@@ -98,3 +98,9 @@ impl EntryRow {
         self.notify("entry");
     }
 }
+
+impl Default for EntryRow {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/session/sidebar/room_row.rs b/src/session/sidebar/room_row.rs
index 1b5f8e21..7283926c 100644
--- a/src/session/sidebar/room_row.rs
+++ b/src/session/sidebar/room_row.rs
@@ -190,3 +190,9 @@ impl RoomRow {
         }
     }
 }
+
+impl Default for RoomRow {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/session/sidebar/row.rs b/src/session/sidebar/row.rs
index 9ff8ed80..c9d57d33 100644
--- a/src/session/sidebar/row.rs
+++ b/src/session/sidebar/row.rs
@@ -175,3 +175,9 @@ impl Row {
         self.notify("list-row");
     }
 }
+
+impl Default for Row {
+    fn default() -> Self {
+        Self::new()
+    }
+}
diff --git a/src/session/sidebar/sidebar.rs b/src/session/sidebar/sidebar.rs
index 04eebb41..a72090a7 100644
--- a/src/session/sidebar/sidebar.rs
+++ b/src/session/sidebar/sidebar.rs
@@ -255,3 +255,9 @@ impl Sidebar {
         self.notify("selected-room");
     }
 }
+
+impl Default for Sidebar {
+    fn default() -> Self {
+        Self::new()
+    }
+}


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