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:
parent
93f7de03e2
commit
b1a4cc044d
1 changed files with 1 additions and 1 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue