Better Debug impl for InternedWrapper

This commit is contained in:
Florian Diebold 2021-05-09 20:05:43 +02:00
parent 0f7f1f0705
commit aebcf7b5d4

View file

@ -15,9 +15,15 @@ use std::{fmt, sync::Arc};
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct Interner;
#[derive(PartialEq, Eq, Hash, Debug)]
#[derive(PartialEq, Eq, Hash)]
pub struct InternedWrapper<T>(T);
impl<T: fmt::Debug> fmt::Debug for InternedWrapper<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Debug::fmt(&self.0, f)
}
}
impl<T> std::ops::Deref for InternedWrapper<T> {
type Target = T;