Skip to content

Commit

Permalink
Clippy fixes for latest version of Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpringle committed Aug 24, 2023
1 parent 9f7e6d5 commit ce5a5bb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions firewood/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl growthring::wal::Record for AshRecord {
undo.offset
.to_le_bytes()
.into_iter()
.chain(undo_data_len.to_le_bytes().into_iter())
.chain(undo_data_len.to_le_bytes())
.chain(undo.data.iter().copied())
.chain(redo.data.iter().copied())
});
Expand All @@ -103,7 +103,7 @@ impl growthring::wal::Record for AshRecord {
.flat_map(|(space_id_bytes, undo_len, ash_bytes)| {
space_id_bytes
.into_iter()
.chain(undo_len.to_le_bytes().into_iter())
.chain(undo_len.to_le_bytes())
.chain(ash_bytes)
});

Expand Down
4 changes: 2 additions & 2 deletions firewood/src/v2/emptydb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ mod tests {

assert_eq!(proposal.val(b"k").await.unwrap().unwrap(), b"v");

assert!(matches!(proposal.val(b"z").await.unwrap(), None));
assert!(proposal.val(b"z").await.unwrap().is_none());

Ok(())
}
Expand Down Expand Up @@ -129,7 +129,7 @@ mod tests {
assert_eq!(proposal1.val(b"k").await.unwrap().unwrap(), b"v");
assert_eq!(proposal2.val(b"k").await.unwrap().unwrap(), b"v");
// only proposal1 doesn't have z
assert!(matches!(proposal1.val(b"z").await.unwrap(), None));
assert!(proposal1.val(b"z").await.unwrap().is_none());
// proposal2 has z with value "undo"
assert_eq!(proposal2.val(b"z").await.unwrap().unwrap(), b"undo");

Expand Down
6 changes: 3 additions & 3 deletions firewood/tests/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ fn test_empty_range_proof() -> Result<(), ProofError> {
items.sort();
let merkle = merkle_build_test(items.clone(), 0x10000, 0x10000)?;

let cases = vec![(items.len() - 1, false)];
let cases = [(items.len() - 1, false)];
for (_, c) in cases.iter().enumerate() {
let first = increase_key(items[c.0].0);
let proof = merkle.prove(first)?;
Expand Down Expand Up @@ -942,7 +942,7 @@ fn test_empty_value_range_proof() -> Result<(), ProofError> {
let empty_data: [u8; 20] = [0; 20];
items.splice(
mid_index..mid_index,
vec![(&key, &empty_data)].iter().cloned(),
[(&key, &empty_data)].iter().cloned(),
);

let start = 1;
Expand Down Expand Up @@ -980,7 +980,7 @@ fn test_all_elements_empty_value_range_proof() -> Result<(), ProofError> {
let empty_data: [u8; 20] = [0; 20];
items.splice(
mid_index..mid_index,
vec![(&key, &empty_data)].iter().cloned(),
[(&key, &empty_data)].iter().cloned(),
);

let start = 0;
Expand Down
2 changes: 1 addition & 1 deletion growth-ring/src/wal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ impl<F: WalFile + 'static, S: WalStore<F>> WalWriter<F, S> {
.collect();

res.into_iter()
.zip(records.into_iter())
.zip(records)
.map(|((ringid, blks), rec)| {
future::try_join_all(blks.into_iter().map(|idx| writes[idx].clone()))
.or_else(|_| future::ready(Err(())))
Expand Down

0 comments on commit ce5a5bb

Please sign in to comment.