Skip to content

Commit

Permalink
Merge pull request #98 from adamreichold/re-export-element
Browse files Browse the repository at this point in the history
Re-export Element trait from selectors crate
  • Loading branch information
cfvescovo committed Jan 11, 2023
2 parents a4b09b3 + e6229ed commit 10d0deb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/error.rs
Expand Up @@ -52,9 +52,7 @@ impl<'a> From<BasicParseErrorKind<'a>> for SelectorErrorKind<'a> {
match err {
BasicParseErrorKind::UnexpectedToken(token) => Self::UnexpectedToken(token),
BasicParseErrorKind::EndOfInput => Self::EndOfLine,
BasicParseErrorKind::AtRuleInvalid(rule) => {
Self::InvalidAtRule(rule.clone().to_string())
}
BasicParseErrorKind::AtRuleInvalid(rule) => Self::InvalidAtRule(rule.to_string()),
BasicParseErrorKind::AtRuleBodyInvalid => Self::InvalidAtRuleBody,
BasicParseErrorKind::QualifiedRuleInvalid => Self::QualRuleInvalid,
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Expand Up @@ -145,6 +145,8 @@ pub use crate::html::Html;
pub use crate::node::Node;
pub use crate::selector::Selector;

pub use selectors::Element;

pub mod element_ref;
pub mod error;
pub mod html;
Expand Down
8 changes: 6 additions & 2 deletions src/node.rs
@@ -1,7 +1,8 @@
//! HTML nodes.

use std::collections::{hash_map, hash_set};
use std::collections::{HashMap, HashSet};
#[cfg(not(feature = "deterministic"))]
use std::collections::{hash_map, HashMap};
use std::collections::{hash_set, HashSet};
use std::fmt;
use std::ops::Deref;

Expand All @@ -11,6 +12,9 @@ use html5ever::{Attribute, LocalName, QualName};
use selectors::attr::CaseSensitivity;

/// An HTML node.
// `Element` is usally the most common variant and hence boxing it
// will most likely not improve performance overall.
#[allow(variant_size_differences)]
#[derive(Clone, PartialEq, Eq)]
pub enum Node {
/// The document root.
Expand Down

0 comments on commit 10d0deb

Please sign in to comment.