@@ -18,73 +18,6 @@ macro_rules! policy_str {
1818 ( $( $arg: tt) * ) => ( $crate:: policy:: Concrete :: from_str( & format!( $( $arg) * ) ) . unwrap( ) )
1919}
2020
21- /// Macro for implementing FromTree trait. This avoids copying all the Pk::Associated type bounds
22- /// throughout the codebase.
23- macro_rules! impl_from_tree {
24- ( $( ; $gen: ident; $gen_con: ident, ) * $name: ty,
25- $( #[ $meta: meta] ) *
26- fn $fn: ident ( $( $arg: ident : $type: ty) ,* ) -> $ret: ty
27- $body: block
28- ) => {
29- impl <Pk $( , $gen) * > $crate:: expression:: FromTree for $name
30- where
31- Pk : $crate:: FromStrKey ,
32- $( $gen : $gen_con, ) *
33- {
34-
35- $( #[ $meta] ) *
36- fn $fn( $( $arg: $type) * ) -> $ret {
37- $body
38- }
39- }
40- } ;
41- }
42-
43- /// Macro for implementing FromStr trait. This avoids copying all the Pk::Associated type bounds
44- /// throughout the codebase.
45- macro_rules! impl_from_str {
46- ( $( ; $gen: ident; $gen_con: ident, ) * $name: ty,
47- type Err = $err_ty: ty; ,
48- $( #[ $meta: meta] ) *
49- fn $fn: ident ( $( $arg: ident : $type: ty) ,* ) -> $ret: ty
50- $body: block
51- ) => {
52- impl <Pk $( , $gen) * > core:: str :: FromStr for $name
53- where
54- Pk : $crate:: FromStrKey ,
55- $( $gen : $gen_con, ) *
56- {
57- type Err = $err_ty;
58-
59- $( #[ $meta] ) *
60- fn $fn( $( $arg: $type) * ) -> $ret {
61- $body
62- }
63- }
64- } ;
65- }
66-
67- /// Macro for impl Struct with associated bounds. This avoids copying all the Pk::Associated type bounds
68- /// throughout the codebase.
69- macro_rules! impl_block_str {
70- ( $( ; $gen: ident; $gen_con: ident, ) * $name: ty,
71- $( #[ $meta: meta] ) *
72- $v: vis fn $fn: ident ( $( $arg: ident : $type: ty, ) * ) -> $ret: ty
73- $body: block
74- ) => {
75- impl <Pk $( , $gen) * > $name
76- where
77- Pk : $crate:: FromStrKey ,
78- $( $gen : $gen_con, ) *
79- {
80- $( #[ $meta] ) *
81- $v fn $fn( $( $arg: $type, ) * ) -> $ret {
82- $body
83- }
84- }
85- } ;
86- }
87-
8821/// A macro that implements serde serialization and deserialization using the
8922/// `fmt::Display` and `str::FromStr` traits.
9023macro_rules! serde_string_impl_pk {
0 commit comments