Skip to content

Commit

Permalink
chore: Remove unused base16 dependency and dead hex wrapper funct…
Browse files Browse the repository at this point in the history
…ion (#8207)

### Description

Noticed these dependencies/functions were unused.

For the most part, it's better to do these conversions with the built-in
`format!()`.

Parsing base16 could make sense for this as a dependency, but we're not
doing that.

### Testing Instructions

```
cargo check
```

Also grepped through next.js to check that we're not using it there.
  • Loading branch information
bgw authored May 24, 2024
1 parent 827bea9 commit 46fe083
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 23 deletions.
8 changes: 0 additions & 8 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions crates/turbo-tasks-hash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ bench = false
workspace = true

[dependencies]
base16 = "0.2.1"
hex = "0.4.3"
md4 = "0.10.1"
turbo-tasks-macros = { workspace = true }
twox-hash = "1.6.3"
4 changes: 0 additions & 4 deletions crates/turbo-tasks-hash/src/base16.rs

This file was deleted.

5 changes: 0 additions & 5 deletions crates/turbo-tasks-hash/src/hex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@
pub fn encode_hex(n: u64) -> String {
format!("{:01$x}", n, std::mem::size_of::<u64>() * 2)
}

/// Encodes a byte slice into a hex string.
pub fn encode_hex_string(bytes: &[u8]) -> String {
hex::encode(bytes)
}
4 changes: 1 addition & 3 deletions crates/turbo-tasks-hash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
//! invalidation, and encoding the hash to an hexadecimal string for use in a
//! file name.

mod base16;
mod deterministic_hash;
mod hex;
mod md4;
mod xxh3_hash64;

pub use crate::{
base16::encode_base16,
deterministic_hash::{DeterministicHash, DeterministicHasher},
hex::{encode_hex, encode_hex_string},
hex::encode_hex,
md4::hash_md4,
xxh3_hash64::{hash_xxh3_hash64, Xxh3Hash64Hasher},
};
2 changes: 1 addition & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ allow = [
"MPL-2.0-no-copyleft-exception",
# enum-iterator*
"0BSD",
# base16, notify
# notify
"CC0-1.0",
# Inflector, hyper-tungstenite
"BSD-2-Clause",
Expand Down

0 comments on commit 46fe083

Please sign in to comment.