Skip to content

Commit

Permalink
create_mock_future: Implement Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
FSMaxB committed Jan 7, 2025
1 parent dae9664 commit 0965f12
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions async-time-mock-shared/src/create_mock_future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,19 @@ macro_rules! create_mock_future {
},
}
}

impl ::core::fmt::Debug for $name
where
$real_future: ::core::fmt::Debug,
{
fn fmt(&self, formatter: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
use __MockFutureEnum::*;
match &self.future {
Real { future } => ::core::fmt::Debug::fmt(future, formatter),
#[cfg(feature = "mock")]
Mock { future } => formatter.debug_tuple("Mock").finish(),
}
}
}
};
}

0 comments on commit 0965f12

Please sign in to comment.