Allow trailing commas for bounded_vec! (#10959)

This commit is contained in:
Zeke Mostov
2022-03-02 00:40:08 -08:00
committed by GitHub
parent 5a0b12bb5d
commit f3e9c0af04
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -1480,7 +1480,7 @@ fn rebond_is_fifo() {
active: 300,
unlocking: bounded_vec![
UnlockChunk { value: 400, era: 2 + 3 },
UnlockChunk { value: 300, era: 3 + 3 }
UnlockChunk { value: 300, era: 3 + 3 },
],
claimed_rewards: vec![],
})
@@ -1499,7 +1499,7 @@ fn rebond_is_fifo() {
unlocking: bounded_vec![
UnlockChunk { value: 400, era: 2 + 3 },
UnlockChunk { value: 300, era: 3 + 3 },
UnlockChunk { value: 200, era: 4 + 3 }
UnlockChunk { value: 200, era: 4 + 3 },
],
claimed_rewards: vec![],
})
@@ -1515,7 +1515,7 @@ fn rebond_is_fifo() {
active: 500,
unlocking: bounded_vec![
UnlockChunk { value: 400, era: 2 + 3 },
UnlockChunk { value: 100, era: 3 + 3 }
UnlockChunk { value: 100, era: 3 + 3 },
],
claimed_rewards: vec![],
})
+1 -1
View File
@@ -123,7 +123,7 @@ impl TypeId for PalletId {
#[macro_export]
#[cfg(feature = "std")]
macro_rules! bounded_vec {
($ ($values:expr),* ) => {
($ ($values:expr),* $(,)?) => {
{
use $crate::sp_std::convert::TryInto as _;
$crate::sp_std::vec![$($values),*].try_into().unwrap()