Skip to content

Commit

Permalink
chore: Update html5ever to 0.25
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Raits <[email protected]>
  • Loading branch information
ignatenkobrain committed Dec 26, 2020
1 parent f7776e8 commit e84b283
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ categories = []
edition = "2018"

[dependencies]
regex = "1"
url = "2.1"
html5ever = "0.24"
lazy_static = "1.4"
regex = "1"
url = "2.1"
html5ever = "0.25"
markup5ever_rcdom = "0.1"
lazy_static = "1.4"

[dependencies.reqwest]
version = "0.10"
Expand Down
4 changes: 2 additions & 2 deletions src/dom.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::rc::Rc;
use html5ever::tendril::StrTendril;
use html5ever::rcdom::NodeData::{Element, Text};
use html5ever::rcdom::{Handle, Node};
use markup5ever_rcdom::NodeData::{Element, Text};
use markup5ever_rcdom::{Handle, Node};
use html5ever::Attribute;
use std::str::FromStr;

Expand Down
6 changes: 3 additions & 3 deletions src/extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::io::Read;
use std::collections::BTreeMap;
use std::path::Path;
use std::cell::Cell;
use html5ever::rcdom::{RcDom};
use markup5ever_rcdom::{RcDom, SerializableHandle};
use html5ever::{parse_document, serialize};
use html5ever::tendril::stream::TendrilSink;
use std::default::Default;
Expand Down Expand Up @@ -72,10 +72,10 @@ pub fn extract<R>(input: &mut R, url: &Url) -> Result<Product, Error> where R: R
}
let mut bytes = vec![];

let node = top_candidate.node.clone();
let node = &top_candidate.node;
scorer::clean(&mut dom, Path::new(id), node.clone(), url, &candidates);

serialize(&mut bytes, &node, Default::default()).ok();
serialize(&mut bytes, &SerializableHandle::from(node.clone()), Default::default()).ok();
let content = String::from_utf8(bytes).unwrap_or_default();

let mut text: String = String::new();
Expand Down
10 changes: 5 additions & 5 deletions src/scorer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ use url::Url;
use regex::Regex;
use lazy_static::lazy_static;
use html5ever::tree_builder::TreeSink;
use html5ever::rcdom::Node;
use html5ever::rcdom::NodeData::{Element, Text};
use html5ever::rcdom::Handle;
use html5ever::rcdom::NodeData::{
use markup5ever_rcdom::Node;
use markup5ever_rcdom::NodeData::{Element, Text};
use markup5ever_rcdom::Handle;
use markup5ever_rcdom::NodeData::{
Document,
Doctype,
Comment,
ProcessingInstruction
};
use html5ever:: rcdom::RcDom;
use markup5ever_rcdom::RcDom;
use html5ever::{QualName, LocalName};
use html5ever::tree_builder::{NodeOrText, ElementFlags};
use html5ever::{ns, namespace_url};
Expand Down

0 comments on commit e84b283

Please sign in to comment.