From 2fbbc825c97d1fd8f710b0a2474946656d78979a Mon Sep 17 00:00:00 2001 From: "Jamil Lambert, PhD" Date: Mon, 28 Apr 2025 11:42:33 +0100 Subject: [PATCH] Allow uninlined format args There is a new lint error on nightly-2025-04-25 "variables can be used directly in the `format!` string". Exclude the lint to allow the existing syntax in `format!` strings. --- addresses/src/lib.rs | 1 + base58/src/lib.rs | 1 + bitcoin/src/lib.rs | 1 + chacha20_poly1305/src/lib.rs | 1 + hashes/src/lib.rs | 1 + hashes/tests/api.rs | 2 ++ hashes/tests/regression.rs | 2 ++ internals/build.rs | 3 +++ internals/src/lib.rs | 1 + io/src/lib.rs | 1 + primitives/src/lib.rs | 2 ++ units/src/lib.rs | 2 ++ 12 files changed, 18 insertions(+) diff --git a/addresses/src/lib.rs b/addresses/src/lib.rs index 15b64efdc..06c99f4e9 100644 --- a/addresses/src/lib.rs +++ b/addresses/src/lib.rs @@ -21,6 +21,7 @@ // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 #![allow(clippy::manual_range_contains)] // More readable than clippy's format. +#![allow(clippy::uninlined_format_args)] // Allow `format!("{}", x)`instead of enforcing `format!("{x}")` extern crate alloc; diff --git a/base58/src/lib.rs b/base58/src/lib.rs index b19759284..be1026fbd 100644 --- a/base58/src/lib.rs +++ b/base58/src/lib.rs @@ -21,6 +21,7 @@ #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 #![allow(clippy::manual_range_contains)] // More readable than clippy's format. #![allow(clippy::incompatible_msrv)] // Has FPs and we're testing it which is more reliable anyway. +#![allow(clippy::uninlined_format_args)] // Allow `format!("{}", x)`instead of enforcing `format!("{x}")` extern crate alloc; diff --git a/bitcoin/src/lib.rs b/bitcoin/src/lib.rs index 4265be8db..e5bddd50d 100644 --- a/bitcoin/src/lib.rs +++ b/bitcoin/src/lib.rs @@ -39,6 +39,7 @@ #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 #![allow(clippy::manual_range_contains)] // More readable than clippy's format. #![allow(clippy::incompatible_msrv)] // Has FPs and we're testing it which is more reliable anyway. +#![allow(clippy::uninlined_format_args)] // Allow `format!("{}", x)`instead of enforcing `format!("{x}")` // We only support machines with index size of 4 bytes or more. // diff --git a/chacha20_poly1305/src/lib.rs b/chacha20_poly1305/src/lib.rs index 7777e0935..043f6877b 100644 --- a/chacha20_poly1305/src/lib.rs +++ b/chacha20_poly1305/src/lib.rs @@ -16,6 +16,7 @@ // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 #![allow(clippy::manual_range_contains)] // More readable than clippy's format. +#![allow(clippy::uninlined_format_args)] // Allow `format!("{}", x)`instead of enforcing `format!("{x}")` #[cfg(feature = "alloc")] extern crate alloc; diff --git a/hashes/src/lib.rs b/hashes/src/lib.rs index b3962214c..3e8c41a6d 100644 --- a/hashes/src/lib.rs +++ b/hashes/src/lib.rs @@ -66,6 +66,7 @@ // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 #![allow(clippy::manual_range_contains)] // More readable than clippy's format. +#![allow(clippy::uninlined_format_args)] // Allow `format!("{}", x)`instead of enforcing `format!("{x}")` #[cfg(feature = "alloc")] extern crate alloc; diff --git a/hashes/tests/api.rs b/hashes/tests/api.rs index 5de01d551..a85eb5547 100644 --- a/hashes/tests/api.rs +++ b/hashes/tests/api.rs @@ -8,6 +8,8 @@ #![allow(dead_code)] #![allow(unused_imports)] +// Exclude lints we don't think are valuable. +#![allow(clippy::uninlined_format_args)] // Allow `format!("{}", x)`instead of enforcing `format!("{x}")` // Import using module style e.g., `sha256::Hash`. use bitcoin_hashes::{ diff --git a/hashes/tests/regression.rs b/hashes/tests/regression.rs index 31aeec5f8..dccff1714 100644 --- a/hashes/tests/regression.rs +++ b/hashes/tests/regression.rs @@ -5,6 +5,8 @@ //! Test input data and expected hashes is the same as in `io/src/hash.rs`. #![cfg(feature = "hex")] +// Exclude lints we don't think are valuable. +#![allow(clippy::uninlined_format_args)] // Allow `format!("{}", x)`instead of enforcing `format!("{x}")` use bitcoin_hashes::{ hash160, ripemd160, sha1, sha256, sha256d, sha256t, sha384, sha512, sha512_256, siphash24, diff --git a/internals/build.rs b/internals/build.rs index 7ac6c70fd..fff95c4b9 100644 --- a/internals/build.rs +++ b/internals/build.rs @@ -1,3 +1,6 @@ +// Exclude lints we don't think are valuable. +#![allow(clippy::uninlined_format_args)] // Allow `format!("{}", x)`instead of enforcing `format!("{x}")` + const MAX_USED_VERSION: u64 = 80; use std::io; diff --git a/internals/src/lib.rs b/internals/src/lib.rs index 35c179142..e86dfda69 100644 --- a/internals/src/lib.rs +++ b/internals/src/lib.rs @@ -15,6 +15,7 @@ // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 #![allow(clippy::manual_range_contains)] // More readable than clippy's format. +#![allow(clippy::uninlined_format_args)] // Allow `format!("{}", x)`instead of enforcing `format!("{x}")` #[cfg(feature = "alloc")] extern crate alloc; diff --git a/io/src/lib.rs b/io/src/lib.rs index f92ec11f3..e5bf1e1eb 100644 --- a/io/src/lib.rs +++ b/io/src/lib.rs @@ -24,6 +24,7 @@ // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 #![allow(clippy::manual_range_contains)] // More readable than clippy's format. +#![allow(clippy::uninlined_format_args)] // Allow `format!("{}", x)`instead of enforcing `format!("{x}")` #[cfg(feature = "alloc")] extern crate alloc; diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index f9dafc05a..b3b15958a 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -16,6 +16,8 @@ #![warn(missing_docs)] #![warn(deprecated_in_future)] #![doc(test(attr(warn(unused))))] +// Exclude lints we don't think are valuable. +#![allow(clippy::uninlined_format_args)] // Allow `format!("{}", x)`instead of enforcing `format!("{x}")` #[cfg(feature = "alloc")] extern crate alloc; diff --git a/units/src/lib.rs b/units/src/lib.rs index 41c33b017..30327ba30 100644 --- a/units/src/lib.rs +++ b/units/src/lib.rs @@ -25,6 +25,8 @@ #![warn(missing_docs)] #![warn(deprecated_in_future)] #![doc(test(attr(warn(unused))))] +// Exclude lints we don't think are valuable. +#![allow(clippy::uninlined_format_args)] // Allow `format!("{}", x)`instead of enforcing `format!("{x}")` #[cfg(feature = "alloc")] extern crate alloc;