diff options
author | bryan newbold <bnewbold@robocracy.org> | 2023-08-20 17:18:09 -0700 |
---|---|---|
committer | bryan newbold <bnewbold@robocracy.org> | 2023-08-20 17:18:09 -0700 |
commit | 77960a92ae8aabeae4e957b7a1d86fe550d287a9 (patch) | |
tree | 0b986b8b63e04ff3dea808d3ab1f4198264d1b20 | |
parent | a9294857ddad1df37ef6f7c2ac2188ba27eec224 (diff) | |
download | adenosine-77960a92ae8aabeae4e957b7a1d86fe550d287a9.tar.gz adenosine-77960a92ae8aabeae4e957b7a1d86fe550d287a9.zip |
cargo clippy clean (rust v1.70)
-rw-r--r-- | adenosine/src/car.rs | 6 | ||||
-rw-r--r-- | adenosine/src/repo.rs | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/adenosine/src/car.rs b/adenosine/src/car.rs index 67c97e9..e425f7e 100644 --- a/adenosine/src/car.rs +++ b/adenosine/src/car.rs @@ -92,12 +92,10 @@ async fn inner_car_bytes_reader( let mut car_writer = CarWriter::new(car_header, buf); let cid_list = db.get_descendants::<Vec<_>>(root)?; - for cid in cid_list { + // TODO: only load the first root CID from list; sometimes others are missing. should handle this better + if let Some(cid) = cid_list.into_iter().next() { let block = db.get_block(&cid)?.expect("block content"); car_writer.write(cid, block).await?; - // TODO: only load the first root CID from list; sometimes others are missing. should - // handle this better - break; } Ok(car_writer.finish().await?) } diff --git a/adenosine/src/repo.rs b/adenosine/src/repo.rs index 3fb3a40..ca3c849 100644 --- a/adenosine/src/repo.rs +++ b/adenosine/src/repo.rs @@ -250,7 +250,7 @@ impl RepoStore { let new_mst_cid = self .update_mst(&last_commit.mst_cid, mutations) .context("updating MST in repo")?; - self.write_commit(did, Some(last_commit.commit_cid), new_mst_cid, &signing_key) + self.write_commit(did, Some(last_commit.commit_cid), new_mst_cid, signing_key) } /// Reads in a full MST tree starting at a repo commit, then re-builds and re-writes the tree |