diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2022-11-06 21:15:12 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2022-11-06 21:15:12 -0800 |
commit | ae03334a64b1d7d6506ffb60a01f5c7f941900a6 (patch) | |
tree | 87ffe21c51e2e404d798a9e257079410ac044fde /adenosine-pds/src/mst.rs | |
parent | 8c217067ee5132c6e5453e1c09b2391880e51d83 (diff) | |
download | adenosine-ae03334a64b1d7d6506ffb60a01f5c7f941900a6.tar.gz adenosine-ae03334a64b1d7d6506ffb60a01f5c7f941900a6.zip |
pds: partial clippy clean
Diffstat (limited to 'adenosine-pds/src/mst.rs')
-rw-r--r-- | adenosine-pds/src/mst.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/adenosine-pds/src/mst.rs b/adenosine-pds/src/mst.rs index 94e5f68..324d139 100644 --- a/adenosine-pds/src/mst.rs +++ b/adenosine-pds/src/mst.rs @@ -98,7 +98,7 @@ pub fn dump_mst_keys(db_path: &PathBuf) -> Result<()> { // print all the aliases for (alias, commit_cid) in all_aliases.iter() { - let did = String::from_utf8_lossy(&alias); + let did = String::from_utf8_lossy(alias); println!("{} -> {}", did, commit_cid); } @@ -164,7 +164,7 @@ fn leading_zeros(key: &str) -> u8 { let digest = sha256::digest(key); let digest = digest.as_bytes(); for i in 0..digest.len() { - if digest[i] != '0' as u8 { + if digest[i] != b'0' { return i as u8; } } @@ -182,7 +182,7 @@ pub fn generate_mst( let entry = WipEntry { height, key: key.clone(), - val: val.clone(), + val: *val, right: None, }; if let Some(node) = root { @@ -293,7 +293,7 @@ fn serialize_wip_tree( e: entries, }; let block = Block::<DefaultParams>::encode(DagCborCodec, Code::Sha2_256, &mst_node)?; - let cid = block.cid().clone(); + let cid = *block.cid(); db.put_block(block, None)?; Ok(cid) } @@ -331,7 +331,7 @@ pub fn repro_mst(car_path: &PathBuf) -> Result<()> { collect_mst_keys(&mut db, &root_node.data, &mut repo_map)?; // now re-generate nodes - let updated = generate_mst(&mut db, &mut repo_map)?; + let updated = generate_mst(&mut db, &repo_map)?; info!("original root: {}", root_node.data); info!("regenerated : {}", updated); |