Skip to content

Commit

Permalink
fmt: disable "unused" warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirbaio committed Mar 20, 2024
1 parent 7c2aae8 commit 3d842da
Show file tree
Hide file tree
Showing 22 changed files with 37 additions and 55 deletions.
3 changes: 1 addition & 2 deletions cyw43/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-boot-nrf/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-boot-rp/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-boot-stm32/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-boot/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-executor/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-futures/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-hal-internal/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
29 changes: 16 additions & 13 deletions embassy-net-adin1110/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -83,14 +83,17 @@ macro_rules! todo {
};
}

#[cfg(not(feature = "defmt"))]
macro_rules! unreachable {
($($x:tt)*) => {
{
#[cfg(not(feature = "defmt"))]
::core::unreachable!($($x)*);
#[cfg(feature = "defmt")]
::defmt::unreachable!($($x)*);
}
::core::unreachable!($($x)*)
};
}

#[cfg(feature = "defmt")]
macro_rules! unreachable {
($($x:tt)*) => {
::defmt::unreachable!($($x)*)
};
}

Expand All @@ -113,7 +116,7 @@ macro_rules! trace {
#[cfg(feature = "defmt")]
::defmt::trace!($s $(, $x)*);
#[cfg(not(any(feature = "log", feature="defmt")))]
let _ignored = ($( & $x ),*);
let _ = ($( & $x ),*);
}
};
}
Expand All @@ -126,7 +129,7 @@ macro_rules! debug {
#[cfg(feature = "defmt")]
::defmt::debug!($s $(, $x)*);
#[cfg(not(any(feature = "log", feature="defmt")))]
let _ignored = ($( & $x ),*);
let _ = ($( & $x ),*);
}
};
}
Expand All @@ -139,7 +142,7 @@ macro_rules! info {
#[cfg(feature = "defmt")]
::defmt::info!($s $(, $x)*);
#[cfg(not(any(feature = "log", feature="defmt")))]
let _ignored = ($( & $x ),*);
let _ = ($( & $x ),*);
}
};
}
Expand All @@ -152,7 +155,7 @@ macro_rules! warn {
#[cfg(feature = "defmt")]
::defmt::warn!($s $(, $x)*);
#[cfg(not(any(feature = "log", feature="defmt")))]
let _ignored = ($( & $x ),*);
let _ = ($( & $x ),*);
}
};
}
Expand All @@ -165,7 +168,7 @@ macro_rules! error {
#[cfg(feature = "defmt")]
::defmt::error!($s $(, $x)*);
#[cfg(not(any(feature = "log", feature="defmt")))]
let _ignored = ($( & $x ),*);
let _ = ($( & $x ),*);
}
};
}
Expand Down Expand Up @@ -226,7 +229,7 @@ impl<T, E> Try for Result<T, E> {
}
}

pub struct Bytes<'a>(pub &'a [u8]);
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
Expand Down
3 changes: 1 addition & 2 deletions embassy-net-driver-channel/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-net-enc28j60/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-net-esp-hosted/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-net-ppp/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-net/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-nrf/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-rp/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-stm32-wpan/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-stm32/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-sync/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-time/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-usb-dfu/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down
3 changes: 1 addition & 2 deletions embassy-usb/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![macro_use]
#![allow(unused_macros)]
#![allow(unused)]

use core::fmt::{Debug, Display, LowerHex};

Expand Down Expand Up @@ -229,7 +229,6 @@ impl<T, E> Try for Result<T, E> {
}
}

#[allow(unused)]
pub(crate) struct Bytes<'a>(pub &'a [u8]);

impl<'a> Debug for Bytes<'a> {
Expand Down

0 comments on commit 3d842da

Please sign in to comment.