Skip to content

Commit

Permalink
Change *EntryRef Debug impl Generics to where
Browse files Browse the repository at this point in the history
Because otherwise those impls are too long for one line
  • Loading branch information
ToMe25 committed May 30, 2024
1 parent 092e3ce commit 1c8b695
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4406,8 +4406,12 @@ where
Vacant(VacantEntryRef<'a, 'b, K, Q, V, S, A>),
}

impl<K: Borrow<Q>, Q: ?Sized + Debug, V: Debug, S, A: Allocator> Debug
for EntryRef<'_, '_, K, Q, V, S, A>
impl<K, Q, V, S, A> Debug for EntryRef<'_, '_, K, Q, V, S, A>
where
K: Borrow<Q>,
Q: Debug + ?Sized,
V: Debug,
A: Allocator,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
Expand Down Expand Up @@ -4510,8 +4514,12 @@ where
{
}

impl<K: Borrow<Q>, Q: ?Sized + Debug, V: Debug, S, A: Allocator> Debug
for OccupiedEntryRef<'_, '_, K, Q, V, S, A>
impl<K, Q, V, S, A> Debug for OccupiedEntryRef<'_, '_, K, Q, V, S, A>
where
K: Borrow<Q>,
Q: Debug + ?Sized,
V: Debug,
A: Allocator,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("OccupiedEntryRef")
Expand Down Expand Up @@ -4557,8 +4565,11 @@ pub struct VacantEntryRef<'a, 'b, K, Q: ?Sized, V, S, A: Allocator = Global> {
table: &'a mut HashMap<K, V, S, A>,
}

impl<K: Borrow<Q>, Q: ?Sized + Debug, V, S, A: Allocator> Debug
for VacantEntryRef<'_, '_, K, Q, V, S, A>
impl<K, Q, V, S, A> Debug for VacantEntryRef<'_, '_, K, Q, V, S, A>
where
K: Borrow<Q>,
Q: Debug + ?Sized,
A: Allocator,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_tuple("VacantEntryRef").field(&self.key()).finish()
Expand Down

0 comments on commit 1c8b695

Please sign in to comment.