From: Ian Jackson Date: Sun, 2 May 2021 22:56:34 +0000 (+0100) Subject: Provide DebugExt::to_debug X-Git-Tag: otter-0.6.0~466 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=56efe5c3b0b569e93a470e470250919956f3a003;p=otter.git Provide DebugExt::to_debug Signed-off-by: Ian Jackson --- diff --git a/base/misc.rs b/base/misc.rs index c6bbe061..faa47bc4 100644 --- a/base/misc.rs +++ b/base/misc.rs @@ -84,3 +84,8 @@ macro_rules! if_let { }; }; } + +#[ext(pub, name=DebugExt)] +impl T { + fn to_debug(&self) -> String { format!("{:?}", self) } +}