@@ -229,25 +229,6 @@ impl StyleChecker {
229229 self . state = initial_state;
230230 }
231231
232- /// If we see a normal s! macro without any attributes we just need
233- /// to check if there are any duplicates.
234- fn handle_s_macro_no_attrs ( & mut self , item_macro : & syn:: ItemMacro ) {
235- let span = item_macro. span ( ) ;
236- match self . seen_s_macro_cfgs . get ( "" ) {
237- Some ( seen_span) => {
238- self . error (
239- "duplicate s! macro" . to_string ( ) ,
240- span,
241- format ! ( "other s! macro" ) ,
242- ( Some ( * seen_span) , "combine the two" . to_string ( ) ) ,
243- ) ;
244- }
245- None => {
246- self . seen_s_macro_cfgs . insert ( String :: new ( ) , span) ;
247- }
248- }
249- }
250-
251232 /// If an s! macro has attributes we check for any duplicates as well
252233 /// as if they are standalone positive cfgs that would be better
253234 /// in a separate file.
@@ -354,9 +335,7 @@ impl<'ast> Visit<'ast> for StyleChecker {
354335 /// instead of [syn::Macro] because it contains the attributes.
355336 fn visit_item_macro ( & mut self , item_macro : & ' ast syn:: ItemMacro ) {
356337 if item_macro. mac . path . is_ident ( "s" ) {
357- if item_macro. attrs . is_empty ( ) {
358- self . handle_s_macro_no_attrs ( item_macro) ;
359- } else {
338+ if !item_macro. attrs . is_empty ( ) {
360339 self . handle_s_macro_with_attrs ( item_macro) ;
361340 }
362341 }
0 commit comments