From 885fc8428c3c6532f368e3b6bfbc8235413531ab Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Sun, 12 May 2024 16:23:04 -0700 Subject: [PATCH] enable `deref_by_slicing` lint --- Cargo.toml | 1 + src/api/client_server/sync.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 26ffd0d5..bdf40ddb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ assertions_on_result_states = "warn" cloned_instead_of_copied = "warn" dbg_macro = "warn" default_union_representation = "warn" +deref_by_slicing = "warn" empty_drop = "warn" filetype_is_file = "warn" float_cmp_const = "warn" diff --git a/src/api/client_server/sync.rs b/src/api/client_server/sync.rs index 60f54e4f..0e3cc38c 100644 --- a/src/api/client_server/sync.rs +++ b/src/api/client_server/sync.rs @@ -1608,7 +1608,7 @@ pub(crate) async fn sync_events_v4_route( }) .take(5) .collect::>(); - let name = match &heroes[..] { + let name = match &*heroes { [] => None, [only] => Some(only.0.clone()), [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() } else { None