mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-25 03:15:08 +00:00
86c534f244
10440: Fix Clippy warnings and replace some `if let`s with `match` r=Veykril a=arzg I decided to try fixing a bunch of Clippy warnings. I am aware of this project’s opinion of Clippy (I have read both [rust-lang/clippy#5537](https://github.com/rust-lang/rust-clippy/issues/5537) and [rust-analyzer/rowan#57 (comment)](https://github.com/rust-analyzer/rowan/pull/57#discussion_r415676159)), so I totally understand if part of or the entirety of this PR is rejected. In particular, I can see how the semicolons and `if let` vs `match` commits provide comparatively little benefit when compared to the ensuing churn. I tried to separate each kind of change into its own commit to make it easier to discard certain changes. I also only applied Clippy suggestions where I thought they provided a definite improvement to the code (apart from semicolons, which is IMO more of a formatting/consistency question than a linting question). In the end I accumulated a list of 28 Clippy lints I ignored entirely. Sidenote: I should really have asked about this on Zulip before going through all 1,555 `if let`s in the codebase to decide which ones definitely look better as `match` :P Co-authored-by: Aramis Razzaghipour <aramisnoah@gmail.com> |
||
---|---|---|
.. | ||
add_explicit_type.rs | ||
add_lifetime_to_type.rs | ||
add_missing_impl_members.rs | ||
add_missing_match_arms.rs | ||
add_return_type.rs | ||
add_turbo_fish.rs | ||
apply_demorgan.rs | ||
auto_import.rs | ||
change_visibility.rs | ||
convert_bool_then.rs | ||
convert_comment_block.rs | ||
convert_integer_literal.rs | ||
convert_into_to_from.rs | ||
convert_iter_for_each_to_for.rs | ||
convert_to_guarded_return.rs | ||
convert_tuple_struct_to_named_struct.rs | ||
convert_while_to_loop.rs | ||
destructure_tuple_binding.rs | ||
expand_glob_import.rs | ||
extract_function.rs | ||
extract_struct_from_enum_variant.rs | ||
extract_type_alias.rs | ||
extract_variable.rs | ||
fix_visibility.rs | ||
flip_binexpr.rs | ||
flip_comma.rs | ||
flip_trait_bound.rs | ||
generate_default_from_enum_variant.rs | ||
generate_default_from_new.rs | ||
generate_deref.rs | ||
generate_derive.rs | ||
generate_enum_is_method.rs | ||
generate_enum_projection_method.rs | ||
generate_from_impl_for_enum.rs | ||
generate_function.rs | ||
generate_getter.rs | ||
generate_impl.rs | ||
generate_is_empty_from_len.rs | ||
generate_new.rs | ||
generate_setter.rs | ||
inline_call.rs | ||
inline_local_variable.rs | ||
introduce_named_generic.rs | ||
introduce_named_lifetime.rs | ||
invert_if.rs | ||
merge_imports.rs | ||
merge_match_arms.rs | ||
move_bounds.rs | ||
move_from_mod_rs.rs | ||
move_guard.rs | ||
move_module_to_file.rs | ||
move_to_mod_rs.rs | ||
pull_assignment_up.rs | ||
qualify_path.rs | ||
raw_string.rs | ||
remove_dbg.rs | ||
remove_mut.rs | ||
remove_unused_param.rs | ||
reorder_fields.rs | ||
reorder_impl.rs | ||
replace_derive_with_manual_impl.rs | ||
replace_if_let_with_match.rs | ||
replace_let_with_if_let.rs | ||
replace_qualified_name_with_use.rs | ||
replace_string_with_char.rs | ||
sort_items.rs | ||
split_import.rs | ||
toggle_ignore.rs | ||
unmerge_use.rs | ||
unwrap_block.rs | ||
wrap_return_type_in_result.rs |