Skip to content

Commit 11e7b10

Browse files
committed
highlight: Make README snippets compile
1 parent b5d2aa7 commit 11e7b10

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

highlight/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extern "C" tree_sitter_javascript();
1717
Define the list of highlight names that you will recognize:
1818

1919
```rust
20-
let highlight_names = [
20+
let highlight_names : Vec<String> = [
2121
"attribute",
2222
"constant",
2323
"function.builtin",
@@ -93,14 +93,14 @@ let highlights = highlighter.highlight(
9393
).unwrap();
9494

9595
for event in highlights {
96-
match event? {
96+
match event.unwrap() {
9797
HighlightEvent::Source {start, end} => {
9898
eprintln!("source: {}-{}", start, end);
9999
},
100-
HighlightEvent::HighlightStart(s) {
100+
HighlightEvent::HighlightStart(s) => {
101101
eprintln!("highlight style started: {:?}", s);
102102
},
103-
HighlightEvent::HighlightEnd {
103+
HighlightEvent::HighlightEnd => {
104104
eprintln!("highlight style ended");
105105
},
106106
}

0 commit comments

Comments
 (0)