Fix Clippy lints (#3494)

* chore: fix some Clippy lints

* chore(labrinth): more Clippy fixes
This commit is contained in:
Alejandro González
2025-04-12 15:45:17 +02:00
committed by GitHub
parent 365367dd16
commit e008b657a5
6 changed files with 10 additions and 13 deletions

View File

@@ -78,7 +78,7 @@ pub async fn import_curseforge(
let icon_bytes =
fetch(&thumbnail_url, None, &state.fetch_semaphore, &state.pool)
.await?;
let filename = thumbnail_url.rsplit('/').last();
let filename = thumbnail_url.rsplit('/').next_back();
if let Some(filename) = filename {
icon = Some(
write_cached_icon(

View File

@@ -139,9 +139,7 @@ pub async fn write(
})
})
.await
.map_err(|_| {
std::io::Error::new(std::io::ErrorKind::Other, "background task failed")
})??;
.map_err(|_| std::io::Error::other("background task failed"))??;
Ok(())
}
@@ -152,8 +150,7 @@ fn sync_write(
) -> Result<(), std::io::Error> {
let mut tempfile =
NamedTempFile::new_in(path.as_ref().parent().ok_or_else(|| {
std::io::Error::new(
std::io::ErrorKind::Other,
std::io::Error::other(
"could not get parent directory for temporary file",
)
})?)?;