Apply a larger swath of clippy warnings.
We should go through the list of all the clippy lints, and turn on any that are currently allow
that we don't want in our code.
Some of these are correctness or API critical, so we should get this done in an earlier milestone.
Here are the ones that caught my eye:
-
#![deny(clippy::await_holding_lock)]
-
#![deny(clippy::cast_lossless)]
-
#![deny(clippy::clone_on_ref_ptr)]
-
#![deny(clippy::cognitive_complexity)]
-
#![deny(clippy::debug_assert_with_mut_call)]
-
#![deny(clippy::expl_impl_clone_on_copy)]
-
#![deny(clippy::fallible_impl_from)]
-
#![deny(clippy::large_stack_arrays)]
-
#![deny(clippy::manual_ok_or)]
-
#![deny(clippy::missing_docs_in_private_items)]
-
#![deny(clippy::missing_panics_doc)]
-
#![warn(clippy::needless_borrow)]
-
#![warn(clippy::needless_pass_by_value)]
-
#![deny(clippy::option_option)]
-
#![deny(clippy::rc_buffer)]
-
#![deny(clippy::ref_option_ref)]
-
#![deny(clippy::trait_duplication_in_bounds)]
-
#![deny(clippy::unwrap_used)]
-
#![deny(clippy::unseparated_literal_suffix)]
-
#![deny(clippy::cargo_common_metadata)]
-
#![deny(clippy::implicit_clone)]
-
#![deny(clippy::checked_conversions)]
Decided not to do (yet):
#![deny(clippy::expect_used)]
#![deny(clippy::redundant_pub_crate)]
#![deny(clippy::unnecessary_wraps)]
#![deny(clippy::panic)]
#![deny(clippy::future_not_send)]
#![deny(clippy::redundant_closure_for_method_calls)]
#![deny(clippy::too_many_lines)]
#![deny(clippy::if_then_some_else_none)]
#![deny(clippy::option_if_let_else)]
#![deny(clippy::str_to_string)]
#![deny(missing_debug_implementations)]
#![deny(clippy::pub_enum_variant_names)]
(Note that probably we don't want to actually do all of these warnings. If we try to turn something on, but the changes it would require ugly, we should reconsider.)
Edited by Nick Mathewson