parenthesized!, braced! and bracketed! macros are very verbous in situations where you want to handle Err in current function beacause in this case they are expand in return statement. That's why they must be public.
Code example:
If you have an optional code in parentheses and you don't need the paren token:
if input.peek(token::Paren) {
let paren_content;
parenthesized!(paren_content in input);
paren_content.parse::<ExprUnsafe>()?;
}
vs
if let Ok(Parens { token: _, content}) = parse_parens(input) {
content.parse::<ExprUnsafe>()?;
}
1519
parenthesized!, braced! and bracketed! macros are very verbous in situations where you want to handle Err in current function beacause in this case they are expand in return statement. That's why they must be public.
Code example:
If you have an optional code in parentheses and you don't need the paren token:
vs