Skip to content

Commit 8a997b1

Browse files
committed
Merge rust-bitcoin/rust-bitcoin#1010: Match against an optional single trailing colon
88ce8fe Match against an optional single trailing colon (Tobin C. Harding) Pull request description: Currently we allow multiple trailing colons when matching within the `check_format_non_negative` macro. We can be more restrictive with no loss of usability. Use `$(;)?` instead of `$(;)*` to match against 0 or 1 semi-colons instead of 0 or more. Done as part of the [edition 2018 checklist](rust-bitcoin/rust-bitcoin#510). ACKs for top commit: Kixunil: ACK 88ce8fe apoelstra: ACK 88ce8fe Tree-SHA512: 4409c094f6a0aa49ddebdad850fd1d5a31a57dae8828f5a1db0ee5a855e1bce9e43aea69fa0b4d132068c3a43f1f62d35409b9ac5b32ed876e4dd586829e8e68
2 parents c9d41ec + a2587c5 commit 8a997b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/amount.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ mod tests {
16401640

16411641
// Creates individual test functions to make it easier to find which check failed.
16421642
macro_rules! check_format_non_negative {
1643-
($denom:ident; $($test_name:ident, $val:expr, $format_string:expr, $expected:expr);* $(;)*) => {
1643+
($denom:ident; $($test_name:ident, $val:expr, $format_string:expr, $expected:expr);* $(;)?) => {
16441644
$(
16451645
#[test]
16461646
fn $test_name() {
@@ -1652,7 +1652,7 @@ mod tests {
16521652
}
16531653

16541654
macro_rules! check_format_non_negative_show_denom {
1655-
($denom:ident, $denom_suffix:expr; $($test_name:ident, $val:expr, $format_string:expr, $expected:expr);* $(;)*) => {
1655+
($denom:ident, $denom_suffix:expr; $($test_name:ident, $val:expr, $format_string:expr, $expected:expr);* $(;)?) => {
16561656
$(
16571657
#[test]
16581658
fn $test_name() {

0 commit comments

Comments
 (0)