Allow unused variables in release mode

In release mode we have a few unused variable warnings, lets just
allow them.

Found when running bench code, interestingly `cargo bench` must build
in release mode.
This commit is contained in:
Tobin C. Harding 2024-09-05 12:44:13 +10:00
parent e2ff08635e
commit eb67e873e0
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 3 additions and 0 deletions

View File

@ -159,6 +159,7 @@ struct DisplayWrapper<'a, T: 'a + Encodable, E>(&'a T, PhantomData<E>);
impl<'a, T: 'a + Encodable, E: ByteEncoder> fmt::Display for DisplayWrapper<'a, T, E> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut writer = IoWrapper::<'_, _, E::Encoder>::new(f, E::default().into());
#[allow(unused_variables)] // When debug_assertions are not enabled.
self.0.consensus_encode(&mut writer).map_err(|error| {
#[cfg(debug_assertions)]
{
@ -199,6 +200,7 @@ impl<W: fmt::Write> ErrorTrackingWriter<W> {
}
#[track_caller]
#[allow(unused_variables)] // When debug_assertions are not enabled.
fn assert_no_error(&self, fun: &str) {
#[cfg(debug_assertions)]
{
@ -217,6 +219,7 @@ impl<W: fmt::Write> ErrorTrackingWriter<W> {
}
}
#[allow(unused_variables)] // When debug_assertions are not enabled.
fn set_error(&mut self, was: bool) {
#[cfg(debug_assertions)]
{