From b07e55f126d600b1723bcb946e09a06d998b158d Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Thu, 5 Oct 2023 11:25:01 -0400 Subject: [PATCH] Resolve warnings in gm-control-panel --- gm-control-panel/src/app_window.rs | 2 +- gm-control-panel/src/playlist_card.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gm-control-panel/src/app_window.rs b/gm-control-panel/src/app_window.rs index 26574f2..360c289 100644 --- a/gm-control-panel/src/app_window.rs +++ b/gm-control-panel/src/app_window.rs @@ -45,7 +45,7 @@ impl ApplicationWindow { ] .into_iter() .map(|name| { - let playlist = PlaylistCard::new(); + let playlist = PlaylistCard::default(); playlist.set_name(name); playlist }) diff --git a/gm-control-panel/src/playlist_card.rs b/gm-control-panel/src/playlist_card.rs index d1d0007..d099582 100644 --- a/gm-control-panel/src/playlist_card.rs +++ b/gm-control-panel/src/playlist_card.rs @@ -31,8 +31,8 @@ glib::wrapper! { pub struct PlaylistCard(ObjectSubclass) @extends gtk::Box, gtk::Widget, @implements gtk::Orientable; } -impl PlaylistCard { - pub fn new() -> Self { +impl Default for PlaylistCard { + fn default() -> Self { let s: Self = Object::builder().build(); s.set_orientation(gtk::Orientation::Vertical); s.add_css_class("playlist-card"); @@ -43,7 +43,9 @@ impl PlaylistCard { s } +} +impl PlaylistCard { pub fn set_name(&self, s: &str) { self.imp().name.set_text(s); }