build: bump all dependencies and set MSRV to 1.94; fix build failures

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I7d331410864358d30191781d1e6c23f46a6a6964
This commit is contained in:
raf 2026-04-21 17:21:39 +03:00
commit 8b2140c057
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
12 changed files with 248 additions and 196 deletions

View file

@ -72,17 +72,17 @@ pub async fn execute(
&format!("Add {} to lockfile?", file_path.display()),
false,
global_yes,
)? {
if let Ok(file_data) = fs::read(file_path) {
use sha1::Digest;
let mut hasher = sha1::Sha1::new();
hasher.update(&file_data);
let hash = format!("{:x}", hasher.finalize());
file_hashes.push(FileHash {
path: file_path.clone(),
hash,
});
}
)? && let Ok(file_data) = fs::read(file_path)
{
use sha1::Digest;
let mut hasher = sha1::Sha1::new();
hasher.update(&file_data);
let hash =
crate::utils::hash::hash_to_hex(hasher.finalize().as_slice());
file_hashes.push(FileHash {
path: file_path.clone(),
hash,
});
}
}
@ -91,8 +91,7 @@ pub async fn execute(
let result = add_files_batch(&mut lockfile, file_hashes).await;
if let Err(e) = result {
log::warn!(
"Batch lookup failed, falling back to individual lookups: {}",
e
"Batch lookup failed, falling back to individual lookups: {e}"
);
for fh in fallback_hashes {
if let Err(e) =
@ -220,7 +219,7 @@ async fn add_file_to_lockfile(
use sha1::Digest;
let mut hasher = sha1::Sha1::new();
hasher.update(&file_data);
let hash = format!("{:x}", hasher.finalize());
let hash = crate::utils::hash::hash_to_hex(hasher.finalize().as_slice());
// Try Modrinth first (SHA-1 hash)
if let Ok(Some(project)) = modrinth.lookup_by_hash(&hash).await {
@ -279,7 +278,11 @@ async fn add_files_batch(
for file_info in &project.files {
for (idx, fh) in file_hashes.iter().enumerate() {
if !matched_indices.contains(&idx)
&& file_info.hashes.get("sha1").map(|s| s.as_str()) == Some(&fh.hash)
&& file_info
.hashes
.get("sha1")
.map(std::string::String::as_str)
== Some(&fh.hash)
{
lockfile.add_project(project.clone());
added_pakku_ids.insert(pakku_id.clone());