Skip to content

Commit

Permalink
hotfix os independent bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-eth committed Aug 27, 2024
1 parent f978305 commit 7190ffa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use std::{
env,
fs::{self, File},
io::{BufReader, Read, Write},
os::unix::ffi::OsStrExt as _,
path::{Path, PathBuf},
sync::{
atomic::{AtomicBool, Ordering},
Expand Down Expand Up @@ -212,7 +211,7 @@ pub fn hash_folder(
}
// first hash the filename/dirname to make sure it can't be renamed or removed
let mut hasher = <Sha256 as Digest>::new();
hasher.update(path.as_os_str().as_bytes());
hasher.update(path.to_string_lossy().as_bytes());
// for files, also hash the contents
if let Some(true) = entry.file_type().map(|t| t.is_file()) {
if let Ok(file) = File::open(path) {
Expand Down

0 comments on commit 7190ffa

Please sign in to comment.