Skip to content

Commit 370f32e

Browse files
tchardingpythcoiner
authored andcommitted
Use rustfmt::skip instead of cfg_attr
Currently we use `cfg_attr` to disable the formatter so that the attribute can be on an expression. There was a new lint introduced into nightly just recently that checks cfg args, this `cfg_attr` usage triggers it. Use `rustfmt::skip` instead and put it on the function because it doesn't currently work on expressions.
1 parent 4144b20 commit 370f32e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/sign_multisig.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ fn spending_transaction() -> bitcoin::Transaction {
9393
}
9494
}
9595

96+
#[rustfmt::skip]
9697
fn list_of_three_arbitrary_public_keys() -> Vec<bitcoin::PublicKey> {
97-
#[cfg_attr(feature="cargo-fmt", rustfmt_skip)]
9898
vec![
9999
bitcoin::PublicKey::from_slice(&[2; 33]).expect("key 1"),
100100
bitcoin::PublicKey::from_slice(&[

examples/verify_tx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ fn main() {
102102
}
103103

104104
/// Returns an arbitrary transaction.
105+
#[rustfmt::skip]
105106
fn hard_coded_transaction() -> bitcoin::Transaction {
106107
// tx `f27eba163c38ad3f34971198687a3f1882b7ec818599ffe469a8440d82261c98`
107-
#[cfg_attr(feature="cargo-fmt", rustfmt_skip)]
108108
let tx_bytes = vec![
109109
0x01, 0x00, 0x00, 0x00, 0x02, 0xc5, 0x11, 0x1d, 0xb7, 0x93, 0x50, 0xc1,
110110
0x70, 0x28, 0x41, 0x39, 0xe8, 0xe3, 0x4e, 0xb0, 0xed, 0xba, 0x64, 0x7b,

0 commit comments

Comments
 (0)