Browse Source

clippy: Implement Default where possible

merge-requests/1327/merge
Kai A. Hiller 5 years ago
parent
commit
44c55b7ab0
  1. 6
      src/components/avatar.rs
  2. 6
      src/components/context_menu_bin.rs
  3. 6
      src/components/pill.rs
  4. 6
      src/components/room_title.rs
  5. 6
      src/components/spinner_button.rs
  6. 6
      src/login.rs
  7. 6
      src/session/content/explore/public_room_row.rs
  8. 6
      src/session/content/invite.rs
  9. 6
      src/session/content/item_row.rs
  10. 6
      src/session/content/markdown_popover.rs
  11. 6
      src/session/content/message_row.rs
  12. 6
      src/session/content/room_history.rs
  13. 6
      src/session/content/state_row.rs
  14. 6
      src/session/mod.rs
  15. 6
      src/session/sidebar/category_row.rs
  16. 6
      src/session/sidebar/entry_row.rs
  17. 6
      src/session/sidebar/room_row.rs
  18. 6
      src/session/sidebar/row.rs
  19. 6
      src/session/sidebar/sidebar.rs

6
src/components/avatar.rs

@ -133,3 +133,9 @@ impl Avatar {
}
}
}
impl Default for Avatar {
fn default() -> Self {
Self::new()
}
}

6
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()
}
}

6
src/components/pill.rs

@ -172,3 +172,9 @@ impl Pill {
priv_.room.borrow().clone()
}
}
impl Default for Pill {
fn default() -> Self {
Self::new()
}
}

6
src/components/room_title.rs

@ -143,3 +143,9 @@ impl RoomTitle {
priv_.subtitle.borrow().clone()
}
}
impl Default for RoomTitle {
fn default() -> Self {
Self::new()
}
}

6
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()
}
}

6
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)

6
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()
}
}

6
src/session/content/invite.rs

@ -248,3 +248,9 @@ impl Invite {
Some(())
}
}
impl Default for Invite {
fn default() -> Self {
Self::new()
}
}

6
src/session/content/item_row.rs

@ -228,3 +228,9 @@ impl ItemRow {
}
}
}
impl Default for ItemRow {
fn default() -> Self {
Self::new()
}
}

6
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()
}
}

6
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()
}
}

6
src/session/content/room_history.rs

@ -328,3 +328,9 @@ impl RoomHistory {
}
}
}
impl Default for RoomHistory {
fn default() -> Self {
Self::new()
}
}

6
src/session/content/state_row.rs

@ -178,3 +178,9 @@ impl StateRow {
};
}
}
impl Default for StateRow {
fn default() -> Self {
Self::new()
}
}

6
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()
}
}

6
src/session/sidebar/category_row.rs

@ -155,3 +155,9 @@ impl CategoryRow {
self.notify("expanded");
}
}
impl Default for CategoryRow {
fn default() -> Self {
Self::new()
}
}

6
src/session/sidebar/entry_row.rs

@ -98,3 +98,9 @@ impl EntryRow {
self.notify("entry");
}
}
impl Default for EntryRow {
fn default() -> Self {
Self::new()
}
}

6
src/session/sidebar/room_row.rs

@ -190,3 +190,9 @@ impl RoomRow {
}
}
}
impl Default for RoomRow {
fn default() -> Self {
Self::new()
}
}

6
src/session/sidebar/row.rs

@ -175,3 +175,9 @@ impl Row {
self.notify("list-row");
}
}
impl Default for Row {
fn default() -> Self {
Self::new()
}
}

6
src/session/sidebar/sidebar.rs

@ -255,3 +255,9 @@ impl Sidebar {
self.notify("selected-room");
}
}
impl Default for Sidebar {
fn default() -> Self {
Self::new()
}
}

Loading…
Cancel
Save