Skip to content

Commit 35d59e7

Browse files
committed
Remove explicit 'static lifetime
Clippy emits: warning: statics have by default a `'static` lifetime Static strings no longer need an explicit lifetime, remove it.
1 parent 1a582db commit 35d59e7

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

src/ecdh.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,7 @@ mod tests {
272272
0xff, 0xff, 0, 0, 0xff, 0xff, 0, 0,
273273
99, 99, 99, 99, 99, 99, 99, 99
274274
];
275-
static STR: &'static str = "\
276-
01010101010101010001020304050607ffff0000ffff00006363636363636363\
277-
";
275+
static STR: &str = "01010101010101010001020304050607ffff0000ffff00006363636363636363";
278276

279277
let secret = SharedSecret::from_slice(&BYTES).unwrap();
280278

src/key.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,9 +2108,8 @@ mod test {
21082108
0xff, 0xff, 0, 0, 0xff, 0xff, 0, 0,
21092109
99, 99, 99, 99, 99, 99, 99, 99
21102110
];
2111-
static SK_STR: &'static str = "\
2112-
01010101010101010001020304050607ffff0000ffff00006363636363636363\
2113-
";
2111+
static SK_STR: &str = "01010101010101010001020304050607ffff0000ffff00006363636363636363";
2112+
21142113
#[cfg(fuzzing)]
21152114
static PK_BYTES: [u8; 33] = [
21162115
0x02,
@@ -2119,9 +2118,7 @@ mod test {
21192118
0x06, 0x83, 0x7f, 0x30, 0xaa, 0x0c, 0xd0, 0x54,
21202119
0x4a, 0xc8, 0x87, 0xfe, 0x91, 0xdd, 0xd1, 0x66,
21212120
];
2122-
static PK_STR: &'static str = "\
2123-
0218845781f631c48f1c9709e23092067d06837f30aa0cd0544ac887fe91ddd166\
2124-
";
2121+
static PK_STR: &str = "0218845781f631c48f1c9709e23092067d06837f30aa0cd0544ac887fe91ddd166";
21252122

21262123
#[cfg(not(fuzzing))]
21272124
let s = Secp256k1::new();
@@ -2238,9 +2235,7 @@ mod test {
22382235
0xff, 0xff, 0, 0, 0xff, 0xff, 0, 0,
22392236
99, 99, 99, 99, 99, 99, 99, 99
22402237
];
2241-
static SK_STR: &'static str = "\
2242-
01010101010101010001020304050607ffff0000ffff00006363636363636363\
2243-
";
2238+
static SK_STR: &str = "01010101010101010001020304050607ffff0000ffff00006363636363636363";
22442239

22452240
let sk = KeyPairWrapper(KeyPair::from_seckey_slice(&crate::SECP256K1, &SK_BYTES).unwrap());
22462241
assert_tokens(&sk.compact(), &[

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ mod tests {
10011001
226, 108, 150, 124, 57, 38, 206, 112, 44, 249, 125, 75, 1, 0, 98, 225,
10021002
147, 247, 99, 25, 15, 103, 118
10031003
];
1004-
static SIG_STR: &'static str = "\
1004+
static SIG_STR: &str = "\
10051005
30450221009d0bad576719d32ae76bedb34c774866673cbde3f4e12951555c9408e6ce77\
10061006
4b02202876e7102f204f6bfee26c967c3926ce702cf97d4b010062e193f763190f6776\
10071007
";

src/schnorr.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,17 +548,15 @@ mod tests {
548548
0x9e, 0x4d, 0x4e, 0xf5, 0x67, 0x8a, 0xd0, 0xd9, 0xd5, 0x32, 0xc0, 0xdf, 0xa9, 0x07,
549549
0xb5, 0x68, 0x72, 0x2d, 0x0b, 0x01, 0x19, 0xba,
550550
];
551-
static SIG_STR: &'static str = "\
551+
static SIG_STR: &str = "\
552552
14d0bf1a8953506fb460f58be141af767fd112535fb3922ef217308e2c26706f1eeb432b3dba9a01082f9e4d4ef5678ad0d9d532c0dfa907b568722d0b0119ba\
553553
";
554554

555555
static PK_BYTES: [u8; 32] = [
556556
24, 132, 87, 129, 246, 49, 196, 143, 28, 151, 9, 226, 48, 146, 6, 125, 6, 131, 127,
557557
48, 170, 12, 208, 84, 74, 200, 135, 254, 145, 221, 209, 102
558558
];
559-
static PK_STR: &'static str = "\
560-
18845781f631c48f1c9709e23092067d06837f30aa0cd0544ac887fe91ddd166\
561-
";
559+
static PK_STR: &str = "18845781f631c48f1c9709e23092067d06837f30aa0cd0544ac887fe91ddd166";
562560
let pk = XOnlyPublicKey::from_slice(&PK_BYTES).unwrap();
563561

564562
assert_tokens(&sig.compact(), &[Token::BorrowedBytes(&SIG_BYTES[..])]);

0 commit comments

Comments
 (0)