use quick_xml::events::BytesStart;
pub(super) fn attr_str(e: &BytesStart<'_>, key: &[u8]) -> Option<String> {
e.attributes()
.filter_map(|a| a.ok())
.find(|a| a.key.as_ref() == key)
.and_then(|a| String::from_utf8(a.value.to_vec()).ok())
}
pub(super) fn attr_is_yes(e: &BytesStart<'_>, key: &[u8]) -> bool {
e.attributes()
.filter_map(|a| a.ok())
.any(|a| a.key.as_ref() == key && a.value.as_ref() == b"yes")
}
pub(super) fn attr_present(e: &BytesStart<'_>, key: &[u8]) -> bool {
e.attributes()
.filter_map(|a| a.ok())
.any(|a| a.key.as_ref() == key)
}