Fix clippy warnings.

This commit is contained in:
Thomas Frans
2023-02-15 18:06:04 +01:00
committed by Henrik Friedrichsen
parent 8222f1b2e4
commit 829b799cc5
3 changed files with 11 additions and 5 deletions

View File

@@ -35,15 +35,21 @@ pub struct WebApi {
token_expiration: Arc<RwLock<DateTime<Utc>>>,
}
impl WebApi {
pub fn new() -> WebApi {
WebApi {
impl Default for WebApi {
fn default() -> Self {
Self {
api: AuthCodeSpotify::default(),
user: None,
worker_channel: Arc::new(RwLock::new(None)),
token_expiration: Arc::new(RwLock::new(Utc::now())),
}
}
}
impl WebApi {
pub fn new() -> WebApi {
Self::default()
}
pub fn set_user(&mut self, user: Option<String>) {
self.user = user;