mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
add iter_on_single_itemsclippy lint (#8542)
This commit is contained in:
@ -155,6 +155,7 @@ useless_let_if_seq = "warn"
|
|||||||
use_self = "warn"
|
use_self = "warn"
|
||||||
missing_const_for_fn = "warn"
|
missing_const_for_fn = "warn"
|
||||||
empty_line_after_doc_comments = "warn"
|
empty_line_after_doc_comments = "warn"
|
||||||
|
iter_on_single_items = "warn"
|
||||||
|
|
||||||
# These are nursery lints which have findings. Allow them for now. Some are not
|
# These are nursery lints which have findings. Allow them for now. Some are not
|
||||||
# quite mature enough for use in our codebase and some we don't really want.
|
# quite mature enough for use in our codebase and some we don't really want.
|
||||||
@ -165,7 +166,6 @@ collection_is_never_read = "allow"
|
|||||||
debug_assert_with_mut_call = "allow"
|
debug_assert_with_mut_call = "allow"
|
||||||
fallible_impl_from = "allow"
|
fallible_impl_from = "allow"
|
||||||
future_not_send = "allow"
|
future_not_send = "allow"
|
||||||
iter_on_single_items = "allow"
|
|
||||||
needless_collect = "allow"
|
needless_collect = "allow"
|
||||||
non_send_fields_in_send_ty = "allow"
|
non_send_fields_in_send_ty = "allow"
|
||||||
redundant_pub_crate = "allow"
|
redundant_pub_crate = "allow"
|
||||||
|
|||||||
@ -2325,7 +2325,7 @@ mod tests {
|
|||||||
chain_spec.clone(),
|
chain_spec.clone(),
|
||||||
StaticFileProvider::read_write(static_dir_path).unwrap(),
|
StaticFileProvider::read_write(static_dir_path).unwrap(),
|
||||||
),
|
),
|
||||||
[&next_head].into_iter(),
|
std::iter::once(&next_head),
|
||||||
);
|
);
|
||||||
|
|
||||||
let expected_result = ForkchoiceUpdated::from_status(PayloadStatusEnum::Syncing);
|
let expected_result = ForkchoiceUpdated::from_status(PayloadStatusEnum::Syncing);
|
||||||
@ -2695,7 +2695,7 @@ mod tests {
|
|||||||
chain_spec.clone(),
|
chain_spec.clone(),
|
||||||
StaticFileProvider::read_write(static_dir_path).unwrap(),
|
StaticFileProvider::read_write(static_dir_path).unwrap(),
|
||||||
),
|
),
|
||||||
[&genesis].into_iter(),
|
std::iter::once(&genesis),
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut engine_rx = spawn_consensus_engine(consensus_engine);
|
let mut engine_rx = spawn_consensus_engine(consensus_engine);
|
||||||
|
|||||||
@ -689,7 +689,7 @@ mod tests {
|
|||||||
let tx = db.tx().unwrap();
|
let tx = db.tx().unwrap();
|
||||||
let factory = HashedPostStateCursorFactory::new(&tx, &sorted);
|
let factory = HashedPostStateCursorFactory::new(&tx, &sorted);
|
||||||
let expected =
|
let expected =
|
||||||
[(address, db_storage.into_iter().chain(post_state_storage).collect())].into_iter();
|
std::iter::once((address, db_storage.into_iter().chain(post_state_storage).collect()));
|
||||||
assert_storage_cursor_order(&factory, expected);
|
assert_storage_cursor_order(&factory, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -724,11 +724,10 @@ mod tests {
|
|||||||
let sorted = hashed_post_state.into_sorted();
|
let sorted = hashed_post_state.into_sorted();
|
||||||
let tx = db.tx().unwrap();
|
let tx = db.tx().unwrap();
|
||||||
let factory = HashedPostStateCursorFactory::new(&tx, &sorted);
|
let factory = HashedPostStateCursorFactory::new(&tx, &sorted);
|
||||||
let expected = [(
|
let expected = std::iter::once((
|
||||||
address,
|
address,
|
||||||
post_state_storage.into_iter().filter(|(_, value)| *value > U256::ZERO).collect(),
|
post_state_storage.into_iter().filter(|(_, value)| *value > U256::ZERO).collect(),
|
||||||
)]
|
));
|
||||||
.into_iter();
|
|
||||||
assert_storage_cursor_order(&factory, expected);
|
assert_storage_cursor_order(&factory, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -762,7 +761,7 @@ mod tests {
|
|||||||
let sorted = hashed_post_state.into_sorted();
|
let sorted = hashed_post_state.into_sorted();
|
||||||
let tx = db.tx().unwrap();
|
let tx = db.tx().unwrap();
|
||||||
let factory = HashedPostStateCursorFactory::new(&tx, &sorted);
|
let factory = HashedPostStateCursorFactory::new(&tx, &sorted);
|
||||||
let expected = [(address, post_state_storage)].into_iter();
|
let expected = std::iter::once((address, post_state_storage));
|
||||||
assert_storage_cursor_order(&factory, expected);
|
assert_storage_cursor_order(&factory, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -797,7 +796,7 @@ mod tests {
|
|||||||
let sorted = hashed_post_state.into_sorted();
|
let sorted = hashed_post_state.into_sorted();
|
||||||
let tx = db.tx().unwrap();
|
let tx = db.tx().unwrap();
|
||||||
let factory = HashedPostStateCursorFactory::new(&tx, &sorted);
|
let factory = HashedPostStateCursorFactory::new(&tx, &sorted);
|
||||||
let expected = [(address, storage)].into_iter();
|
let expected = std::iter::once((address, storage));
|
||||||
assert_storage_cursor_order(&factory, expected);
|
assert_storage_cursor_order(&factory, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user