Skip to main content

body_braces_balanced

Function body_braces_balanced 

Source
pub fn body_braces_balanced(body: &str) -> Result<(), usize>
Expand description

Walk body and confirm { / } balance.

\{ and \} are escapes and do not count.

ยงErrors

Returns the byte offset of the first offending byte: either an unmatched } or the body start when the body ends mid-group.