@@ -104,24 +104,19 @@ pub fn markup(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
104104 name : name. clone ( ) ,
105105 attributes : attributes. clone ( ) ,
106106 } ) ;
107- } else {
108- match stack. last ( ) {
109- Some ( top) => {
110- // Only verify the coherence of the top element on the
111- // stack with a closing element, skip over the check if
112- // the stack is empty as that error will be handled
113- // when the top element gets popped off the stack later
114- let name_str = name. to_string ( ) ;
115- let top_str = top. name . to_string ( ) ;
116- if name_str != top_str {
117- abort ! (
118- name. span( ) , "closing element mismatch" ;
119- close = "found closing element {}" , name_str;
120- open = top. name. span( ) => "expected {}" , top_str
121- ) ;
122- }
123- }
124- _ => { }
107+ } else if let Some ( top) = stack. last ( ) {
108+ // Only verify the coherence of the top element on the
109+ // stack with a closing element, skip over the check if
110+ // the stack is empty as that error will be handled
111+ // when the top element gets popped off the stack later
112+ let name_str = name. to_string ( ) ;
113+ let top_str = top. name . to_string ( ) ;
114+ if name_str != top_str {
115+ abort ! (
116+ name. span( ) , "closing element mismatch" ;
117+ close = "found closing element {}" , name_str;
118+ open = top. name. span( ) => "expected {}" , top_str
119+ ) ;
125120 }
126121 }
127122
0 commit comments