From 93c665fc3c44e48f1fc2da20c676d2c2dce33ce7 Mon Sep 17 00:00:00 2001 From: Alexandre Trendel Date: Fri, 29 Nov 2024 12:51:15 -0500 Subject: [PATCH] clippyyyyyy --- src/api/cached_client.rs | 2 +- src/app/loader.rs | 2 +- src/app/models/main.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/cached_client.rs b/src/api/cached_client.rs index 97ada9dc..5aa4667c 100644 --- a/src/api/cached_client.rs +++ b/src/api/cached_client.rs @@ -144,7 +144,7 @@ enum SpotCacheKey<'a> { UserPlaylists(&'a str, usize, usize), } -impl<'a> SpotCacheKey<'a> { +impl SpotCacheKey<'_> { fn into_raw(self) -> String { match self { Self::SavedAlbums(offset, limit) => format!("me_albums_{offset}_{limit}.json"), diff --git a/src/app/loader.rs b/src/app/loader.rs index 1665d6f7..322694fa 100644 --- a/src/app/loader.rs +++ b/src/app/loader.rs @@ -9,7 +9,7 @@ use std::io::{Error, ErrorKind, Write}; // A wrapper to be able to implement the Write trait on a PixbufLoader struct LocalPixbufLoader<'a>(&'a PixbufLoader); -impl<'a> Write for LocalPixbufLoader<'a> { +impl Write for LocalPixbufLoader<'_> { fn write(&mut self, buf: &[u8]) -> Result { self.0 .write(buf) diff --git a/src/app/models/main.rs b/src/app/models/main.rs index 27da1515..01a10137 100644 --- a/src/app/models/main.rs +++ b/src/app/models/main.rs @@ -203,7 +203,7 @@ impl SongBatch { // We have to split the batch in multiple batches } else { let n = songs.len(); - let iter_count = (n + batch_size - 1) / batch_size; + let iter_count = n.div_ceil(batch_size); (0..iter_count) .map(|i| { let offset = batch.offset + i * batch_size;