Function jsonl_converter::brackets::is_closing_bracket
source · pub fn is_closing_bracket(c: &char) -> bool
Expand description
Checks if a character is a closing bracket. Note: this function does not consider ‘)’ to be a closing bracket because it is not used in JSON.
Arguments
c
- A character.
Returns
true
if the character is a closing bracket.false
if the character is not a closing bracket.
Examples
use jsonl_converter::brackets::is_closing_bracket;
assert_eq!(is_closing_bracket(&']'), true);
assert_eq!(is_closing_bracket(&'a'), false);
assert_eq!(is_closing_bracket(&')'), false);
assert_eq!(is_closing_bracket(&'}'), true);