From: Ian Jackson Date: Mon, 25 Jan 2021 19:26:53 +0000 (+0000) Subject: utils: Improve display_as_debug! so it can pass generic params X-Git-Tag: otter-0.4.0~653 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9c11827d7cc94a110a41b26ad78e0c9aad030b5b;p=otter.git utils: Improve display_as_debug! so it can pass generic params Signed-off-by: Ian Jackson --- diff --git a/src/error.rs b/src/error.rs index 676acb65..22d9f97e 100644 --- a/src/error.rs +++ b/src/error.rs @@ -181,8 +181,8 @@ impl IdForById for PieceId { #[macro_export] macro_rules! display_as_debug { - {$x:ty} => { - impl std::fmt::Display for $x { + {$x:ty $( , $($gen_tt:tt)* )?} => { + impl $( $($gen_tt)* )? std::fmt::Display for $x { #[throws(std::fmt::Error)] fn fmt(&self, f: &mut std::fmt::Formatter) { ::fmt(self, f)?