Skip to main content

has_attribute

Function has_attribute 

Source
pub fn has_attribute(
    doc: &BaseDocument,
    node: NodeId,
    name: &str,
) -> Result<bool>
Expand description

element.hasAttribute(name).

Allocates nothing. It used to allocate twice — the lowercased name, and a clone of the attribute’s whole value, thrown away to answer a boolean — which is a cost with no boundary traffic at all to justify it. See MAPPING.md.