diff options
| author | diogo464 <[email protected]> | 2025-12-09 22:43:40 +0000 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-12-09 22:50:34 +0000 |
| commit | 9aed552c491aaabc84e3141bc70e4d26c03efa85 (patch) | |
| tree | fbf614c2c67e631d97b28b97d8d6d8168355b85d /src/log.rs | |
| parent | a5845673cf052b606f722be10d48c5d963958050 (diff) | |
fixed warnings/lints
Diffstat (limited to 'src/log.rs')
| -rw-r--r-- | src/log.rs | 11 |
1 files changed, 6 insertions, 5 deletions
| @@ -32,6 +32,7 @@ pub trait Format {} | |||
| 32 | pub use defmt::Debug2Format; | 32 | pub use defmt::Debug2Format; |
| 33 | 33 | ||
| 34 | // For tracing or no logging, Debug2Format is a passthrough | 34 | // For tracing or no logging, Debug2Format is a passthrough |
| 35 | #[allow(non_snake_case)] | ||
| 35 | #[cfg(not(feature = "defmt"))] | 36 | #[cfg(not(feature = "defmt"))] |
| 36 | #[inline] | 37 | #[inline] |
| 37 | pub fn Debug2Format<T>(value: &T) -> &T { | 38 | pub fn Debug2Format<T>(value: &T) -> &T { |
| @@ -51,7 +52,7 @@ macro_rules! trace { | |||
| 51 | tracing::trace!($($arg)*); | 52 | tracing::trace!($($arg)*); |
| 52 | 53 | ||
| 53 | #[cfg(not(any(feature = "defmt", feature = "tracing")))] | 54 | #[cfg(not(any(feature = "defmt", feature = "tracing")))] |
| 54 | { let _ = (); } // no-op | 55 | { let _ = format_args!($($arg)*); } // no-op, format_args! borrows without moving |
| 55 | }; | 56 | }; |
| 56 | } | 57 | } |
| 57 | 58 | ||
| @@ -65,7 +66,7 @@ macro_rules! debug { | |||
| 65 | tracing::debug!($($arg)*); | 66 | tracing::debug!($($arg)*); |
| 66 | 67 | ||
| 67 | #[cfg(not(any(feature = "defmt", feature = "tracing")))] | 68 | #[cfg(not(any(feature = "defmt", feature = "tracing")))] |
| 68 | { let _ = (); } // no-op | 69 | { let _ = format_args!($($arg)*); } // no-op, format_args! borrows without moving |
| 69 | }; | 70 | }; |
| 70 | } | 71 | } |
| 71 | 72 | ||
| @@ -79,7 +80,7 @@ macro_rules! info { | |||
| 79 | tracing::info!($($arg)*); | 80 | tracing::info!($($arg)*); |
| 80 | 81 | ||
| 81 | #[cfg(not(any(feature = "defmt", feature = "tracing")))] | 82 | #[cfg(not(any(feature = "defmt", feature = "tracing")))] |
| 82 | { let _ = (); } // no-op | 83 | { let _ = format_args!($($arg)*); } // no-op, format_args! borrows without moving |
| 83 | }; | 84 | }; |
| 84 | } | 85 | } |
| 85 | 86 | ||
| @@ -93,7 +94,7 @@ macro_rules! warn { | |||
| 93 | tracing::warn!($($arg)*); | 94 | tracing::warn!($($arg)*); |
| 94 | 95 | ||
| 95 | #[cfg(not(any(feature = "defmt", feature = "tracing")))] | 96 | #[cfg(not(any(feature = "defmt", feature = "tracing")))] |
| 96 | { let _ = (); } // no-op | 97 | { let _ = format_args!($($arg)*); } // no-op, format_args! borrows without moving |
| 97 | }; | 98 | }; |
| 98 | } | 99 | } |
| 99 | 100 | ||
| @@ -107,7 +108,7 @@ macro_rules! error { | |||
| 107 | tracing::error!($($arg)*); | 108 | tracing::error!($($arg)*); |
| 108 | 109 | ||
| 109 | #[cfg(not(any(feature = "defmt", feature = "tracing")))] | 110 | #[cfg(not(any(feature = "defmt", feature = "tracing")))] |
| 110 | { let _ = (); } // no-op | 111 | { let _ = format_args!($($arg)*); } // no-op, format_args! borrows without moving |
| 111 | }; | 112 | }; |
| 112 | } | 113 | } |
| 113 | 114 | ||
