enable deref_by_slicing lint

This commit is contained in:
Charles Hall 2024-05-12 16:23:04 -07:00
parent 71c48f66c4
commit 885fc8428c
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
2 changed files with 3 additions and 2 deletions

View file

@ -22,6 +22,7 @@ assertions_on_result_states = "warn"
cloned_instead_of_copied = "warn" cloned_instead_of_copied = "warn"
dbg_macro = "warn" dbg_macro = "warn"
default_union_representation = "warn" default_union_representation = "warn"
deref_by_slicing = "warn"
empty_drop = "warn" empty_drop = "warn"
filetype_is_file = "warn" filetype_is_file = "warn"
float_cmp_const = "warn" float_cmp_const = "warn"

View file

@ -1608,7 +1608,7 @@ pub(crate) async fn sync_events_v4_route(
}) })
.take(5) .take(5)
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let name = match &heroes[..] { let name = match &*heroes {
[] => None, [] => None,
[only] => Some(only.0.clone()), [only] => Some(only.0.clone()),
[firsts @ .., last] => Some( [firsts @ .., last] => Some(
@ -1622,7 +1622,7 @@ pub(crate) async fn sync_events_v4_route(
), ),
}; };
let avatar = if let [only] = &heroes[..] { let avatar = if let [only] = &*heroes {
only.1.clone() only.1.clone()
} else { } else {
None None