Skip to content

Commit

Permalink
Merge pull request #108 from adamreichold/also-re-export-case-sensiti…
Browse files Browse the repository at this point in the history
…vity

Re-export selectors' CaseSensitivity enum as it is part of our public API.
  • Loading branch information
cfvescovo committed Feb 26, 2023
2 parents 6abb8cd + 794b5ee commit 9a6a638
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Expand Up @@ -145,7 +145,7 @@ pub use crate::html::Html;
pub use crate::node::Node;
pub use crate::selector::Selector;

pub use selectors::Element;
pub use selectors::{attr::CaseSensitivity, Element};

pub mod element_ref;
pub mod error;
Expand Down
17 changes: 7 additions & 10 deletions src/node.rs
Expand Up @@ -247,16 +247,13 @@ impl Element {
let classes: HashSet<LocalName> = attrs
.iter()
.find(|a| a.name.local.deref() == "class")
.map_or_else(
|| HashSet::new(),
|a| {
a.value
.deref()
.split_whitespace()
.map(LocalName::from)
.collect()
},
);
.map_or_else(HashSet::new, |a| {
a.value
.deref()
.split_whitespace()
.map(LocalName::from)
.collect()
});

Element {
attrs: attrs.into_iter().map(|a| (a.name, a.value)).collect(),
Expand Down

0 comments on commit 9a6a638

Please sign in to comment.