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 (vercel/turborepo#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 283fe8a commit a25cd17
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
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},
};

0 comments on commit a25cd17

Please sign in to comment.