Skip to content

Commit 9455545

Browse files
committed
[function-grep] fixed examples
1 parent 8201997 commit 9455545

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

function-grep/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use function_grep::{supported_languages::{Rust, SupportedLanguage}, ParsedFile};
2121
use tree_sitter::Point;
2222
use tree_sitter::Range;
2323

24-
let results = ParsedFile::search_file( "fn foo() {}\n fn bar()\n", &Rust.to_language("foo")).unwrap();
24+
let results = ParsedFile::search_file( "fn foo() {}\n fn bar()\n", &Rust.to_language("foo").unwrap()).unwrap();
2525
println!("{:?}", results.results());
2626
assert_eq!(results.results(), &[Range { start_byte: 0, end_byte: 11, start_point: Point { row: 0, column: 0 }, end_point: Point { row: 0, column: 11 } }]);
2727
assert_eq!(results.to_string(), "1: fn foo() {}".to_string())
@@ -85,7 +85,7 @@ construct_language!(Rust(tree_sitter_rust::LANGUAGE).[rs]?=name->
8585
value: (closure_expression)) @method-definition
8686
(#eq? @method-name {name}))"
8787
);
88-
let results = ParsedFile::search_file( "fn foo() {}\n fn bar()\n", &Rust.to_language("foo")).unwrap();
88+
let results = ParsedFile::search_file( "fn foo() {}\n fn bar()\n", &Rust.to_language("foo").unwrap()).unwrap();
8989
println!("{:?}", results.results());
9090
assert_eq!(results.results(), &[Range { start_byte: 0, end_byte: 11, start_point: Point { row: 0, column: 0 }, end_point: Point { row: 0, column: 11 } }]);
9191
assert_eq!(results.to_string(), "1: fn foo() {}".to_string())

0 commit comments

Comments
 (0)