Hacker News new | ask | show | jobs
by shadaj 1220 days ago
We support optional elements by wrapping them in `Option<T>` (other annotations are applied to the contents of the option)! So you can define

  struct ... {
    ...
    #[rust_sitter::leaf(text = ",")
    _dangling_comma: Option<()>
  }
1 comments

Perfect, thanks!