Skip to content

Instantly share code, notes, and snippets.

@d6y
d6y / playground.rs
Created December 16, 2020 09:40 — forked from rust-play/playground.rs
Code shared from the Rust Playground
trait Debuggable {
fn debug(self) -> Self;
}
impl<T> Debuggable for T
where
T: Sized + std::fmt::Debug,
{
fn debug(self) -> Self {
dbg!(self)
@d6y
d6y / playground.rs
Created December 16, 2020 09:33 — forked from rust-play/playground.rs
Code shared from the Rust Playground
trait Debuggable {
fn debug(self) -> Self
where
Self: Sized + std::fmt::Debug,
{
dbg!(self)
}
}
impl<T> Debuggable for T {}