feat: enable nursery lints without findings (#7334)

This commit is contained in:
Justin Traglia
2024-03-26 07:53:51 -05:00
committed by GitHub
parent e97c973487
commit d9ce894fa3
2 changed files with 59 additions and 11 deletions

View File

@ -87,16 +87,64 @@ rust.unreachable_pub = "warn"
rustdoc.all = "warn"
rust.unused_must_use = "deny"
rust.rust_2018_idioms = "deny"
clippy.empty_line_after_outer_attr = "deny"
clippy.derive_partial_eq_without_eq = "deny"
clippy.redundant_clone = "deny"
clippy.trait_duplication_in_bounds = "deny"
clippy.uninlined_format_args = "deny"
clippy.equatable_if_let = "deny"
clippy.or_fun_call = "deny"
clippy.branches_sharing_code = "deny"
clippy.useless_let_if_seq = "deny"
clippy.large_stack_frames = "deny"
[workspace.lints.clippy]
# These are some of clippy's nursery (i.e., experimental) lints that we like.
# By default, nursery lints are allowed. Some of the lints below have made good
# suggestions which we fixed. The others didn't have any findings, so we can
# assume they don't have that many false positives. Let's enable them to
# prevent future problems.
branches_sharing_code = "warn"
clear_with_drain = "warn"
derive_partial_eq_without_eq = "warn"
empty_line_after_outer_attr = "warn"
equatable_if_let = "warn"
imprecise_flops = "warn"
iter_on_empty_collections = "warn"
iter_with_drain = "warn"
large_stack_frames = "warn"
manual_clamp = "warn"
mutex_integer = "warn"
needless_pass_by_ref_mut = "warn"
nonstandard_macro_braces = "warn"
or_fun_call = "warn"
path_buf_push_overwrite = "warn"
read_zero_byte_vec = "warn"
redundant_clone = "warn"
suboptimal_flops = "warn"
suspicious_operation_groupings = "warn"
trailing_empty_array = "warn"
trait_duplication_in_bounds = "warn"
transmute_undefined_repr = "warn"
trivial_regex = "warn"
tuple_array_conversions = "warn"
uninhabited_references = "warn"
unused_peekable = "warn"
unused_rounding = "warn"
useless_let_if_seq = "warn"
# 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.
# Explicitly listing should make it easier to fix in the future.
as_ptr_cast_mut = "allow"
cognitive_complexity = "allow"
collection_is_never_read = "allow"
debug_assert_with_mut_call = "allow"
empty_line_after_doc_comments = "allow"
fallible_impl_from = "allow"
future_not_send = "allow"
iter_on_single_items = "allow"
missing_const_for_fn = "allow"
needless_collect = "allow"
non_send_fields_in_send_ty = "allow"
option_if_let_else = "allow"
redundant_pub_crate = "allow"
significant_drop_in_scrutinee = "allow"
significant_drop_tightening = "allow"
string_lit_as_bytes = "allow"
type_repetition_in_bounds = "allow"
unnecessary_struct_initialization = "allow"
use_self = "allow"
[workspace.package]
version = "0.2.0-beta.3"

View File

@ -550,7 +550,7 @@ impl TransactionFetcher {
//
// remove any ended sessions, so that in case of a full cache, alive peers aren't
// removed in favour of lru dead peers
let mut ended_sessions = vec!();
let mut ended_sessions = vec![];
for &peer_id in fallback_peers.iter() {
if is_session_active(peer_id) {
ended_sessions.push(peer_id);