pub fn is_opening_bracket(c: &char) -> bool
Expand description

Checks if a character is an opening bracket. Note: this function does not consider ‘(’ to be an opening bracket because it is not used in JSON.

Arguments

  • c - A character.

Returns

  • true if the character is an opening bracket.
  • false if the character is not an opening bracket.

Examples

use jsonl_converter::brackets::is_opening_bracket;

assert_eq!(is_opening_bracket(&'['), true);
assert_eq!(is_opening_bracket(&'a'), false);
assert_eq!(is_opening_bracket(&'('), false);
assert_eq!(is_opening_bracket(&'{'), true);