Skip to content

Commit bc5b063

Browse files
committed
fixes
1 parent 59e28f8 commit bc5b063

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

crates/pglt_markup/src/lib.rs

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)