Skip to content

Commit

Permalink
Bump and remove dep
Browse files Browse the repository at this point in the history
  • Loading branch information
kimono-koans committed Dec 10, 2024
1 parent 7c60803 commit 6017754
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 90 deletions.
122 changes: 39 additions & 83 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exacl = { version = "0.12.0", default-features = false, optional = true }
xattr = { version = "1.3.1", default-features = false, optional = true }

[dependencies]
ahash = { version = "0.8.11", default-features = false }
foldhash = { version = "0.1.3", default-features = true }
clap = { version = "4.5.23", default-features = true, features = [
"std",
"cargo",
Expand All @@ -47,7 +47,7 @@ time = { version = "0.3.37", default-features = false, features = [
"local-offset",
] }
number_prefix = { version = "0.4.0", default-features = false }
skim = { version = "0.12.2", default-features = false, package = "two_percent" }
skim = { version = "0.12.3", default-features = false, package = "two_percent" }
nu-ansi-term = { version = "0.50.1", default-features = false }
lscolors = { version = "0.20.0", default-features = false, features = [
"nu-ansi-term",
Expand Down
6 changes: 4 additions & 2 deletions src/library/diff_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,11 @@ impl DiffCopy {

#[inline]
fn hash(bytes: &[u8]) -> u64 {
use std::hash::Hasher;
use foldhash::fast::RandomState;
use std::hash::{BuildHasher, Hasher};

let mut hash = ahash::AHasher::default();
let random_state = RandomState::default();
let mut hash = random_state.build_hasher();

hash.write(bytes);
hash.finish()
Expand Down
10 changes: 7 additions & 3 deletions src/library/file_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,15 @@ pub struct HashFileContents<'a> {

impl<'a> HashFileContents<'a> {
pub fn path_to_hash(path: &Path) -> u64 {
let mut ahasher = ahash::AHasher::default();
use foldhash::fast::RandomState;
use std::hash::{BuildHasher, Hasher};

HashFileContents::from(path).hash(&mut ahasher);
let random_state = RandomState::default();
let mut hash = random_state.build_hasher();

ahasher.finish()
HashFileContents::from(path).hash(&mut hash);

hash.finish()
}
}

Expand Down

0 comments on commit 6017754

Please sign in to comment.