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

Remove dead code #295

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions src/dom_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ pub trait NodeHandleExt {
self.get_attribute(name).is_some()
}

/// Returns true if the attribute exists and the predicate matches it.
fn attribute_matches(&self, name: &QualName, f: impl Fn(&str) -> bool) -> bool {
self.get_attribute(name).map_or(false, |v| f(&v))
}

/// Returns true if the attribute exists and has the value mentioned.
fn attribute_is(&self, name: &QualName, expected: &str) -> bool {
self.get_attribute(name).as_deref() == Some(expected)
Expand Down Expand Up @@ -64,25 +59,9 @@ pub trait NodeHandleExt {
/// Appends children (without checking node type).
fn append_children(&self, children: impl Iterator<Item = Self>);

/// Same, but just one.
fn append_child(&self, child: Self)
where
Self: Sized,
{
self.append_children(std::iter::once(child))
}

/// Inserts children before the specified child.
fn insert_children_before(&self, existing: &Self, new: impl Iterator<Item = Self>);

/// Same, but just one.
fn insert_child(&self, existing: &Self, new: Self)
where
Self: Sized,
{
self.insert_children_before(existing, std::iter::once(new))
}

/// Removes the node from its parent and replaces it with the nodes provided.
/// Does nothing if the node has no parent.
fn replace_with(&self, replacements: Vec<Self>)
Expand Down
Loading