Skip to content

Commit e6b451e

Browse files
committed
refactor(schema): change tables() method to return iterator over values
Change SchemaDef::tables() return type from &HashMap<String, TableDef> to impl Iterator<Item = &TableDef> to provide a cleaner API that focuses on the table definitions rather than exposing the internal storage structure. Signed-off-by: Svetlin Ralchev <iamralch@users.noreply.github.com>
1 parent 299093e commit e6b451e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/schema.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ impl SchemaDef {
8787
}
8888

8989
/// Get all table schemas
90-
pub fn tables(&self) -> &HashMap<String, TableDef> {
91-
&self.tables
90+
pub fn tables(&self) -> impl Iterator<Item = &TableDef> {
91+
self.tables.values()
9292
}
9393

9494
/// Parse CREATE TABLE statement

0 commit comments

Comments
 (0)