Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy warnings. #1050

Merged
merged 1 commit into from Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/spotify_api.rs
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layout.rs
Expand Up @@ -342,7 +342,7 @@ impl View for Layout {
}
}

fn call_on_any<'a>(&mut self, s: &Selector, c: AnyCb<'a>) {
fn call_on_any(&mut self, s: &Selector, c: AnyCb<'_>) {
if let Some(view) = self.get_current_view_mut() {
view.call_on_any(s, c);
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/search.rs
Expand Up @@ -94,7 +94,7 @@ impl View for SearchView {
}
}

fn call_on_any<'a>(&mut self, selector: &Selector<'_>, callback: AnyCb<'a>) {
fn call_on_any(&mut self, selector: &Selector<'_>, callback: AnyCb<'_>) {
self.edit.call_on_any(selector, &mut |v| callback(v));
}

Expand Down