Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: impl IntoIterator for ExtensionRegistry
Browse files Browse the repository at this point in the history
ss2165 committed Jan 9, 2024
1 parent d07406c commit 9dd662a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/extension.rs
Original file line number Diff line number Diff line change
@@ -72,6 +72,16 @@ impl ExtensionRegistry {
}
}

impl IntoIterator for ExtensionRegistry {
type Item = (ExtensionId, Extension);

type IntoIter = <BTreeMap<ExtensionId, Extension> as IntoIterator>::IntoIter;

fn into_iter(self) -> Self::IntoIter {
self.0.into_iter()
}
}

/// An Extension Registry containing no extensions.
pub const EMPTY_REG: ExtensionRegistry = ExtensionRegistry(BTreeMap::new());

0 comments on commit 9dd662a

Please sign in to comment.