Fix Rust bindings example (#415)

`Parser::parse` returns `Option<&Tree>`.  An `unwrap()` or similar is required to get the actual `Tree`.
This commit is contained in:
Rob Donnelly 2019-08-08 08:35:23 -07:00 committed by Max Brunsfeld
parent 93f7de03e2
commit b1a4cc044d

View file

@ -34,7 +34,7 @@ Now you can parse source code:
```rust
let source_code = "fn test() {}";
let tree = parser.parse(source_code, None);
let tree = parser.parse(source_code, None).unwrap();
let root_node = tree.root_node();
assert_eq!(root_node.kind(), "source_file");