refactor: impl intoIterator for ColumnsByName
Allows the ColumnsByName to be converted into an iterator yielding owned column names & schema.pull/24376/head
parent
6257918d4c
commit
160628a7f8
|
@ -110,6 +110,15 @@ impl ColumnsByName {
|
|||
}
|
||||
}
|
||||
|
||||
impl IntoIterator for ColumnsByName {
|
||||
type Item = (String, ColumnSchema);
|
||||
type IntoIter = std::collections::btree_map::IntoIter<String, ColumnSchema>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.0.into_iter()
|
||||
}
|
||||
}
|
||||
|
||||
// ColumnsByName is a newtype so that we can implement this `TryFrom` in this crate
|
||||
impl TryFrom<ColumnsByName> for Schema {
|
||||
type Error = schema::builder::Error;
|
||||
|
|
Loading…
Reference in New Issue