diff options
Diffstat (limited to 'examples/tokenize.rs')
-rw-r--r-- | examples/tokenize.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/tokenize.rs b/examples/tokenize.rs index c422f0c..943513a 100644 --- a/examples/tokenize.rs +++ b/examples/tokenize.rs @@ -12,12 +12,12 @@ extern crate html5ever; use std::default::Default; use std::io; -use html5ever::tendril::*; use html5ever::tokenizer::BufferQueue; use html5ever::tokenizer::{CharacterTokens, EndTag, NullCharacterToken, StartTag, TagToken}; use html5ever::tokenizer::{ ParseError, Token, TokenSink, TokenSinkResult, Tokenizer, TokenizerOpts, }; +use io::Read; #[derive(Copy, Clone)] struct TokenPrinter { @@ -84,10 +84,10 @@ impl TokenSink for TokenPrinter { fn main() { let mut sink = TokenPrinter { in_char_run: false }; - 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, |