Merge commit 'daf699911104207a477751916b36a371ee8f7e38' into feature-clean

This commit is contained in:
2025-04-19 17:29:54 +03:00
89 changed files with 4249 additions and 2575 deletions

View File

@@ -9,7 +9,6 @@ bytes = "1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_ini = "0.2.0"
toml = "0.8.12"
sha1_smol = { version = "1.0.0", features = ["std"] }
sha2 = "0.10.8"
url = "2.2"
@@ -18,7 +17,6 @@ zip = "0.6.5"
async_zip = { version = "0.0.17", features = ["chrono", "tokio-fs", "deflate", "bzip2", "zstd", "deflate64"] }
flate2 = "1.0.28"
tempfile = "3.5.0"
urlencoding = "2.1.3"
dashmap = { version = "6.0.1", features = ["serde"] }
chrono = { version = "0.4.19", features = ["serde"] }

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",
)
})?)?;