diff options
Diffstat (limited to 'examples/noop-tokenize.rs')
-rw-r--r-- | examples/noop-tokenize.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/noop-tokenize.rs b/examples/noop-tokenize.rs index d6c62f1..323c429 100644 --- a/examples/noop-tokenize.rs +++ b/examples/noop-tokenize.rs @@ -14,8 +14,8 @@ extern crate html5ever; use std::default::Default; use std::io; -use html5ever::tendril::*; use html5ever::tokenizer::{BufferQueue, Token, TokenSink, TokenSinkResult, Tokenizer}; +use io::Read; struct Sink(Vec<Token>); @@ -31,10 +31,10 @@ impl TokenSink for Sink { } fn main() { - let mut chunk = ByteTendril::new(); - io::stdin().read_to_tendril(&mut chunk).unwrap(); + let mut chunk = Vec::new(); + io::stdin().read_to_end(&mut chunk).unwrap(); let mut input = BufferQueue::new(); - input.push_back(chunk.try_reinterpret().unwrap()); + input.push_back(std::str::from_utf8(&chunk).unwrap().to_string()); let mut tok = Tokenizer::new(Sink(Vec::new()), Default::default()); let _ = tok.feed(&mut input); |