From 0b6fbe7315d32ea5623a0a691ec6ba124e2a02d6 Mon Sep 17 00:00:00 2001 From: Albrecht <14820950+weichweich@users.noreply.github.com> Date: Thu, 18 Feb 2021 12:47:33 +0100 Subject: [PATCH] Benchmark macro: Allow multiple bounds in where (#8116) --- substrate/frame/benchmarking/src/lib.rs | 4 ++-- substrate/frame/benchmarking/src/tests.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/substrate/frame/benchmarking/src/lib.rs b/substrate/frame/benchmarking/src/lib.rs index fd9245d18f..e5a8bb51a2 100644 --- a/substrate/frame/benchmarking/src/lib.rs +++ b/substrate/frame/benchmarking/src/lib.rs @@ -199,12 +199,12 @@ macro_rules! benchmarks_iter { { $( $where_clause:tt )* } ( $( $names:tt )* ) ( $( $names_extra:tt )* ) - where_clause { where $( $where_ty:ty: $where_bound:path ),* $(,)? } + where_clause { where $( $where_bound:tt )* } $( $rest:tt )* ) => { $crate::benchmarks_iter! { { $( $instance)? } - { $( $where_ty: $where_bound ),* } + { $( $where_bound )* } ( $( $names )* ) ( $( $names_extra )* ) $( $rest )* diff --git a/substrate/frame/benchmarking/src/tests.rs b/substrate/frame/benchmarking/src/tests.rs index 53093fdf06..8431f3e46c 100644 --- a/substrate/frame/benchmarking/src/tests.rs +++ b/substrate/frame/benchmarking/src/tests.rs @@ -138,7 +138,8 @@ mod benchmarks { crate::benchmarks!{ where_clause { where - ::OtherEvent: Into<::Event> + ::OtherEvent: Into<::Event> + Clone, + ::Event: Clone, } set_value {