Function jsonl_converter::brackets::is_closing_bracket
source · pub fn is_closing_bracket(c: &char) -> boolExpand 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
trueif the character is a closing bracket.falseif 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);