Skip to content

Commit

Permalink
chore: clippy and remove varu64
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuhvi committed Dec 29, 2023
1 parent 82a5091 commit 96676ae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 60 deletions.
50 changes: 1 addition & 49 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion mast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
[dependencies]
blake3 = "1.5.0"
redb = "1.4.0"
varu64 = "0.7.0"

[dev-dependencies]
proptest = "1.4.0"
Expand Down
11 changes: 1 addition & 10 deletions mast/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ impl Node {
let key_length_encoding_length = len_encoding_length(key_length);
let val_length_encoding_length = len_encoding_length(val_length);

let header = 0_u8
| (key_length_encoding_length << 4)
let header = (key_length_encoding_length << 4)
| (val_length_encoding_length << 2)
| ((self.left.is_some() as u8) << 1)
| (self.right.is_some() as u8);
Expand Down Expand Up @@ -242,14 +241,6 @@ fn hash(bytes: &[u8]) -> Hash {
hasher.finalize()
}

fn varu64_decode(bytes: &[u8]) -> (&[u8], &[u8]) {
let (len, remaining) = varu64::decode(bytes).unwrap();
let value = &remaining[..len as usize];
let rest = &remaining[value.len()..];

(value, rest)
}

fn decode_node(data: (u64, &[u8])) -> Node {
let (ref_count, encoded_node) = data;

Expand Down

0 comments on commit 96676ae

Please sign in to comment.