From 8818a94ad79ebdebdf4c7819bd42e363c63bd630 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 9 May 2023 20:38:46 +0200 Subject: feat: add optional deserializer generics static bounds --- src/util.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/util.rs (limited to 'src/util.rs') diff --git a/src/util.rs b/src/util.rs new file mode 100644 index 0000000..78d2cd4 --- /dev/null +++ b/src/util.rs @@ -0,0 +1,13 @@ +macro_rules! trait_alias { + ( + $(#[$attr: meta])* + $visibility: vis $name: ident$(<$($type_param: ident),*>)?$(: $first_bound: tt $(+ $bound: tt)*)?; + ) => { + $(#[$attr])* + $visibility trait $name $(<$($type_param),*>)? $(: $first_bound $(+ $bound)*)? {} + + impl $name$(<$($type_param),*>)? for T {} + }; +} + +pub(crate) use trait_alias; -- cgit v1.2.3-18-g5258