diff --git a/html5ever/examples/arena.rs b/html5ever/examples/arena.rs
index d084e011..acc05705 100644
--- a/html5ever/examples/arena.rs
+++ b/html5ever/examples/arena.rs
@@ -19,36 +19,32 @@ use std::collections::HashSet;
use std::io::{self, Read};
use std::ptr;
-fn main() {
- let mut bytes = Vec::new();
- io::stdin().read_to_end(&mut bytes).unwrap();
- let arena = typed_arena::Arena::new();
- html5ever_parse_slice_into_arena(&bytes, &arena);
-}
-
+/// By using our Sink type, the arena is filled with parsed HTML.
fn html5ever_parse_slice_into_arena<'a>(bytes: &[u8], arena: Arena<'a>) -> Ref<'a> {
let sink = Sink {
arena,
document: arena.alloc(Node::new(NodeData::Document)),
quirks_mode: QuirksMode::NoQuirks,
};
+
parse_document(sink, Default::default())
.from_utf8()
.one(bytes)
}
type Arena<'arena> = &'arena typed_arena::Arena>;
-
type Ref<'arena> = &'arena Node<'arena>;
-
type Link<'arena> = Cell