mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 12:11:09 +00:00
allow trailing comma (#10841)
This commit is contained in:
committed by
GitHub
parent
b932e27e5b
commit
89dfae9530
@@ -28,9 +28,13 @@
|
|||||||
doc = "Substrate's runtime standard library as compiled without Rust's standard library."
|
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_export]
|
||||||
macro_rules! map {
|
macro_rules! map {
|
||||||
($( $name:expr => $value:expr ),*) => (
|
($( $name:expr => $value:expr ),* $(,)? ) => (
|
||||||
vec![ $( ( $name, $value ) ),* ].into_iter().collect()
|
vec![ $( ( $name, $value ) ),* ].into_iter().collect()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user