fix: walkdir

This commit is contained in:
2025-02-12 11:23:31 +00:00
parent b6bd190252
commit f5b206dad3
4 changed files with 9 additions and 10 deletions

View File

@ -14,7 +14,7 @@ use ffmpeg_rs_raw::DemuxerInfo;
use rocket::form::validate::Contains;
use serde::Serialize;
use sha2::{Digest, Sha256};
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use tokio::fs::File;
use tokio::io::{AsyncRead, AsyncReadExt};
use uuid::Uuid;
@ -232,7 +232,7 @@ impl FileStore {
Ok((out_path, n, hash))
}
pub async fn hash_file(p: &PathBuf) -> Result<Vec<u8>, Error> {
pub async fn hash_file(p: &Path) -> Result<Vec<u8>, Error> {
let mut file = File::open(p).await?;
let mut hasher = Sha256::new();
let mut buf = [0; 4096];