Skip to content

Commit

Permalink
feat(rr/meta): impl Display for MetaInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianSpeitel committed May 21, 2024
1 parent b190f89 commit 741e608
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/data/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ impl<F: Format + ?Sized> Receiver for DebugReceiver<'_, '_, '_, F> {
}
if F::verbosity().show_meta_values() {
if let Some(info) = meta::MetaInfo::about_val(value) {
self.set.entry(&format_args!("#{}", info.name));
self.set.entry(&format_args!("{info}"));
return;
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/rr/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ impl MetaInfo {
}
}

impl core::fmt::Display for MetaInfo {
#[inline]
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "#{}", self.name)
}
}

impl TryFrom<TypeId> for MetaInfo {
type Error = ();

Expand Down

0 comments on commit 741e608

Please sign in to comment.