Skip to content

Commit

Permalink
fix last tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharktheone committed Jan 14, 2025
1 parent fc43016 commit 4199050
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions benches/tree_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ fn wikipedia_main_page(c: &mut Criterion) {
let mut stream = ByteStream::new(Encoding::UTF8, None);
let _ = stream.read_from_file(html_file);

let doc_handle: DocumentHandle<Config> = DocumentBuilderImpl::new_document(None);
let _ = Html5Parser::parse_document(&mut stream, doc_handle.clone(), None);
let mut doc = <DocumentBuilderImpl as DocumentBuilder<Config>>::new_document(None);
let _ = Html5Parser::<Config>::parse_document(&mut stream, &mut doc, None);

group.bench_function("wikipedia main page", |b| {
b.iter(|| {
let tree_iterator = TreeIterator::new(doc_handle.clone());
let tree_iterator = TreeIterator::<Config>::new(&doc);
let _ = tree_iterator.collect::<Vec<NodeId>>();
})
});
Expand All @@ -63,12 +63,12 @@ fn stackoverflow_home(c: &mut Criterion) {
let mut bytestream = ByteStream::new(Encoding::UTF8, None);
let _ = bytestream.read_from_file(html_file);

let doc_handle: DocumentHandle<Config> = DocumentBuilderImpl::new_document(None);
let _ = Html5Parser::parse_document(&mut bytestream, doc_handle.clone(), None);
let mut doc = <DocumentBuilderImpl as DocumentBuilder<Config>>::new_document(None);
let _ = Html5Parser::<Config>::parse_document(&mut bytestream, &mut doc, None);

group.bench_function("stackoverflow home", |b| {
b.iter(|| {
let tree_iterator = TreeIterator::new(doc_handle.clone());
let tree_iterator = TreeIterator::<Config>::new(&doc);
let _ = tree_iterator.collect::<Vec<NodeId>>();
})
});
Expand Down

0 comments on commit 4199050

Please sign in to comment.