Skip to content

Commit

Permalink
Allow trailing commas for bounded_vec! (paritytech#10959)
Browse files Browse the repository at this point in the history
  • Loading branch information
emostov authored Mar 2, 2022
1 parent a934551 commit a7a4c68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions frame/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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![],
})
Expand All @@ -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![],
})
Expand All @@ -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![],
})
Expand Down
2 changes: 1 addition & 1 deletion frame/support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a7a4c68

Please sign in to comment.