Merge pull request #521 from thibautvdv/remove_trailing_commas

Remove trailing commas in macros
This commit is contained in:
Dario Nieuwenhuis 2021-08-19 14:19:17 +02:00 committed by GitHub
commit c6026c7c1a
2 changed files with 6 additions and 6 deletions

View File

@ -1,13 +1,13 @@
#[cfg(feature = "log")] #[cfg(feature = "log")]
macro_rules! net_log { macro_rules! net_log {
(trace, $($arg:expr),*) => { log::trace!($($arg),*); }; (trace, $($arg:expr),*) => { log::trace!($($arg),*) };
(debug, $($arg:expr),*) => { log::debug!($($arg),*); }; (debug, $($arg:expr),*) => { log::debug!($($arg),*) };
} }
#[cfg(feature = "defmt")] #[cfg(feature = "defmt")]
macro_rules! net_log { macro_rules! net_log {
(trace, $($arg:expr),*) => { defmt::trace!($($arg),*); }; (trace, $($arg:expr),*) => { defmt::trace!($($arg),*) };
(debug, $($arg:expr),*) => { defmt::debug!($($arg),*); }; (debug, $($arg:expr),*) => { defmt::debug!($($arg),*) };
} }
#[cfg(not(any(feature = "log", feature = "defmt")))] #[cfg(not(any(feature = "log", feature = "defmt")))]

View File

@ -103,10 +103,10 @@ pub enum Socket<'a> {
macro_rules! dispatch_socket { macro_rules! dispatch_socket {
($self_:expr, |$socket:ident| $code:expr) => { ($self_:expr, |$socket:ident| $code:expr) => {
dispatch_socket!(@inner $self_, |$socket| $code); dispatch_socket!(@inner $self_, |$socket| $code)
}; };
(mut $self_:expr, |$socket:ident| $code:expr) => { (mut $self_:expr, |$socket:ident| $code:expr) => {
dispatch_socket!(@inner mut $self_, |$socket| $code); dispatch_socket!(@inner mut $self_, |$socket| $code)
}; };
(@inner $( $mut_:ident )* $self_:expr, |$socket:ident| $code:expr) => { (@inner $( $mut_:ident )* $self_:expr, |$socket:ident| $code:expr) => {
match $self_ { match $self_ {