From 1c8b69509479663ea23d7090550c0cce3343e9bb Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Thu, 30 May 2024 14:59:34 +0200 Subject: [PATCH] Change *EntryRef Debug impl Generics to where Because otherwise those impls are too long for one line --- src/map.rs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/map.rs b/src/map.rs index 40e59de1f..7f06bd558 100644 --- a/src/map.rs +++ b/src/map.rs @@ -4406,8 +4406,12 @@ where Vacant(VacantEntryRef<'a, 'b, K, Q, V, S, A>), } -impl, Q: ?Sized + Debug, V: Debug, S, A: Allocator> Debug - for EntryRef<'_, '_, K, Q, V, S, A> +impl Debug for EntryRef<'_, '_, K, Q, V, S, A> +where + K: Borrow, + Q: Debug + ?Sized, + V: Debug, + A: Allocator, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { @@ -4510,8 +4514,12 @@ where { } -impl, Q: ?Sized + Debug, V: Debug, S, A: Allocator> Debug - for OccupiedEntryRef<'_, '_, K, Q, V, S, A> +impl Debug for OccupiedEntryRef<'_, '_, K, Q, V, S, A> +where + K: Borrow, + Q: Debug + ?Sized, + V: Debug, + A: Allocator, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("OccupiedEntryRef") @@ -4557,8 +4565,11 @@ pub struct VacantEntryRef<'a, 'b, K, Q: ?Sized, V, S, A: Allocator = Global> { table: &'a mut HashMap, } -impl, Q: ?Sized + Debug, V, S, A: Allocator> Debug - for VacantEntryRef<'_, '_, K, Q, V, S, A> +impl Debug for VacantEntryRef<'_, '_, K, Q, V, S, A> +where + K: Borrow, + Q: Debug + ?Sized, + A: Allocator, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("VacantEntryRef").field(&self.key()).finish()