Skip to content

Commit

Permalink
refactor(player): impl Default instead of new
Browse files Browse the repository at this point in the history
async_lock::OnceCell now implements default
  • Loading branch information
SeaDve committed Nov 18, 2023
1 parent 1792a41 commit e973a9c
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mod imp {
use super::*;
use glib::{once_cell::sync::Lazy, subclass::Signal};

#[derive(glib::Properties)]
#[derive(Default, glib::Properties)]
#[properties(wrapper_type = super::Player)]
pub struct Player {
/// Song being played. If the song is None, the player will stop.
Expand All @@ -73,20 +73,6 @@ mod imp {
impl ObjectSubclass for Player {
const NAME: &'static str = "MsaiPlayer";
type Type = super::Player;

fn new() -> Self {
Self {
song: RefCell::default(),
state: Cell::default(),
position: Cell::default(),
duration: Cell::default(),
gst_play: gst_play::Play::default(),
bus_watch_guard: OnceCell::default(),
// FIXME why does this not have a default impl?
mpris_server: AsyncOnceCell::new(),
metadata: RefCell::default(),
}
}
}

#[glib::derived_properties]
Expand Down

0 comments on commit e973a9c

Please sign in to comment.