Put helper function below where its called
Reading the code is arguably easier if we have seen the call site before seeing the function, saves having to think what the function does.
This commit is contained in:
parent
5076579fb9
commit
83c2a552db
|
@ -509,10 +509,6 @@ mod tests {
|
||||||
use crate::internal_macros::hex;
|
use crate::internal_macros::hex;
|
||||||
use crate::{Block, Txid};
|
use crate::{Block, Txid};
|
||||||
|
|
||||||
/// accepts `pmt_test_$num`
|
|
||||||
#[cfg(feature = "rand-std")]
|
|
||||||
fn pmt_test_from_name(name: &str) { pmt_test(name[9..].parse().unwrap()) }
|
|
||||||
|
|
||||||
#[cfg(feature = "rand-std")]
|
#[cfg(feature = "rand-std")]
|
||||||
macro_rules! pmt_tests {
|
macro_rules! pmt_tests {
|
||||||
($($name:ident),* $(,)?) => {
|
($($name:ident),* $(,)?) => {
|
||||||
|
@ -541,6 +537,10 @@ mod tests {
|
||||||
pmt_test_4095
|
pmt_test_4095
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/// Parses the transaction count out of `name` with form: `pmt_test_$num`.
|
||||||
|
#[cfg(feature = "rand-std")]
|
||||||
|
fn pmt_test_from_name(name: &str) { pmt_test(name[9..].parse().unwrap()) }
|
||||||
|
|
||||||
#[cfg(feature = "rand-std")]
|
#[cfg(feature = "rand-std")]
|
||||||
fn pmt_test(tx_count: usize) {
|
fn pmt_test(tx_count: usize) {
|
||||||
use core::cmp::min;
|
use core::cmp::min;
|
||||||
|
|
Loading…
Reference in New Issue