From b1a4cc044d228fc11360ea90284d16669b40fef5 Mon Sep 17 00:00:00 2001 From: Rob Donnelly Date: Thu, 8 Aug 2019 08:35:23 -0700 Subject: [PATCH] Fix Rust bindings example (#415) `Parser::parse` returns `Option<&Tree>`. An `unwrap()` or similar is required to get the actual `Tree`. --- lib/binding_rust/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/binding_rust/README.md b/lib/binding_rust/README.md index 3e591071..1ee51e2d 100644 --- a/lib/binding_rust/README.md +++ b/lib/binding_rust/README.md @@ -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");