Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-export Element trait from selectors crate #98

Merged
merged 3 commits into from Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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