Skip to content

Commit

Permalink
use exhaustive struct match for manual Debug impl
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jun 20, 2021
1 parent 5b7f1f9 commit 7b2d2cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ pub struct FrameData<'tcx> {
impl<'tcx> std::fmt::Debug for FrameData<'tcx> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
// Omitting `timing`, it does not support `Debug`.
let FrameData { call_id, catch_unwind, timing: _ } = self;
f.debug_struct("FrameData")
.field("call_id", &self.call_id)
.field("catch_unwind", &self.catch_unwind)
.field("call_id", call_id)
.field("catch_unwind", catch_unwind)
.finish()
}
}
Expand Down

0 comments on commit 7b2d2cf

Please sign in to comment.