aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2023-09-28 10:32:45 +0200
committerMartin Fischer <martin@push-f.com>2023-09-28 10:36:08 +0200
commitade1034c46f3c5e50bdf07fd1556b7957011fe98 (patch)
treef2fca47af28508c6172ed7175da7760b80bf0730 /examples
parent3ddeb0cd2d9469bab8dcc49d63424cffb605141e (diff)
docs: improve tokenize example output format
Diffstat (limited to 'examples')
-rw-r--r--examples/tokenize.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/tokenize.rs b/examples/tokenize.rs
index a7c2214..490d4a8 100644
--- a/examples/tokenize.rs
+++ b/examples/tokenize.rs
@@ -1,7 +1,7 @@
//! Let's you easily try out the tokenizer with e.g.
//! printf '<h1>Hello world!</h1>' | cargo run --example=tokenize
-use html5tokenizer::{BasicEmitter, Tokenizer};
+use html5tokenizer::{BasicEmitter, Event, Tokenizer};
use std::io::BufReader;
fn main() {
@@ -14,6 +14,9 @@ fn main() {
eprintln!("error: {:?}", error);
}
let token = token.unwrap();
- println!("{:?}", token);
+ match token {
+ Event::CdataOpen => println!("CDATA open"),
+ Event::Token(token) => println!("{token:?}"),
+ }
}
}