Resolve warnings in gm-control-panel

This commit is contained in:
Savanni D'Gerinel 2023-10-05 11:25:01 -04:00
parent 2084061526
commit 37c60e4346
2 changed files with 5 additions and 3 deletions

View File

@ -45,7 +45,7 @@ impl ApplicationWindow {
]
.into_iter()
.map(|name| {
let playlist = PlaylistCard::new();
let playlist = PlaylistCard::default();
playlist.set_name(name);
playlist
})

View File

@ -31,8 +31,8 @@ glib::wrapper! {
pub struct PlaylistCard(ObjectSubclass<PlaylistCardPrivate>) @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);
}