From b23241899932c25ee4044f8f39825967e527a784 Mon Sep 17 00:00:00 2001 From: Murarth Date: Mon, 6 Feb 2017 15:42:01 -0700 Subject: [PATCH] Cleanup `Planner::run*` implementations Places all `impl_run!` macro invocations inside a single `impl` block. The result is functionally identical, but makes the documentation more readable. --- src/planner.rs | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/planner.rs b/src/planner.rs index 9eb246549..c4ac9940b 100644 --- a/src/planner.rs +++ b/src/planner.rs @@ -202,7 +202,7 @@ impl Planner { } macro_rules! impl_run { - ($name:ident [$( $write:ident ),*] [$( $read:ident ),*]) => (impl Planner { + ($name:ident [$( $write:ident ),*] [$( $read:ident ),*]) => ( #[allow(missing_docs, non_snake_case, unused_mut)] pub fn $name<$($write,)* $($read,)* F: 'static + Send + FnMut( $(&mut $write,)* $(&$read,)* ) @@ -222,21 +222,23 @@ macro_rules! impl_run { } }); } - }) + ) } -impl_run!( run0w1r [] [R0] ); -impl_run!( run0w2r [] [R0, R1] ); -impl_run!( run0w3r [] [R0, R1, R2] ); -impl_run!( run0w4r [] [R0, R1, R2, R3] ); -impl_run!( run1w0r [W0] [] ); -impl_run!( run1w1r [W0] [R0] ); -impl_run!( run1w2r [W0] [R0, R1] ); -impl_run!( run1w3r [W0] [R0, R1, R2] ); -impl_run!( run1w4r [W0] [R0, R1, R2, R3] ); -impl_run!( run1w5r [W0] [R0, R1, R2, R3, R4] ); -impl_run!( run1w6r [W0] [R0, R1, R2, R3, R4, R5] ); -impl_run!( run1w7r [W0] [R0, R1, R2, R3, R5, R6, R7] ); -impl_run!( run2w0r [W0, W1] [] ); -impl_run!( run2w1r [W0, W1] [R0] ); -impl_run!( run2w2r [W0, W1] [R0, R1] ); +impl Planner { + impl_run!( run0w1r [] [R0] ); + impl_run!( run0w2r [] [R0, R1] ); + impl_run!( run0w3r [] [R0, R1, R2] ); + impl_run!( run0w4r [] [R0, R1, R2, R3] ); + impl_run!( run1w0r [W0] [] ); + impl_run!( run1w1r [W0] [R0] ); + impl_run!( run1w2r [W0] [R0, R1] ); + impl_run!( run1w3r [W0] [R0, R1, R2] ); + impl_run!( run1w4r [W0] [R0, R1, R2, R3] ); + impl_run!( run1w5r [W0] [R0, R1, R2, R3, R4] ); + impl_run!( run1w6r [W0] [R0, R1, R2, R3, R4, R5] ); + impl_run!( run1w7r [W0] [R0, R1, R2, R3, R5, R6, R7] ); + impl_run!( run2w0r [W0, W1] [] ); + impl_run!( run2w1r [W0, W1] [R0] ); + impl_run!( run2w2r [W0, W1] [R0, R1] ); +}