impl automatic heading identifiers

This commit is contained in:
Noah Hellman 2023-01-29 15:10:01 +01:00
parent b726580724
commit 60dcf09c1a
5 changed files with 323 additions and 102 deletions

View file

@ -100,6 +100,11 @@ impl<'s> Attributes<'s> {
}
}
#[must_use]
pub fn get(&self, key: &str) -> Option<&str> {
self.iter().find(|(k, _)| *k == key).map(|(_, v)| v)
}
pub fn iter(&self) -> impl Iterator<Item = (&'s str, &str)> + '_ {
self.0
.iter()