allow trailing comma (#10841)

This commit is contained in:
Tarekk Mohamed Abdalla
2022-02-11 16:38:58 +02:00
committed by GitHub
parent b932e27e5b
commit 89dfae9530
+5 -1
View File
@@ -28,9 +28,13 @@
doc = "Substrate's runtime standard library as compiled without Rust's standard library."
)]
/// Initialize a key-value collection from array.
///
/// Creates a vector of given pairs and calls `collect` on the iterator from it.
/// Can be used to create a `HashMap`.
#[macro_export]
macro_rules! map {
($( $name:expr => $value:expr ),*) => (
($( $name:expr => $value:expr ),* $(,)? ) => (
vec![ $( ( $name, $value ) ),* ].into_iter().collect()
)
}