Merge pull request #79 from haaawk/schema_add_table

Remove unneeded clone in add_table
This commit is contained in:
Pekka Enberg
2024-07-07 09:52:17 +03:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -71,7 +71,7 @@ impl Database {
let root_page: i64 = row.get::<i64>(3)?;
let sql: String = row.get::<String>(4)?;
let table = schema::Table::from_sql(&sql, root_page as usize)?;
schema.add_table(&table.name.to_owned(), table);
schema.add_table(table);
}
RowResult::IO => {
// TODO: How do we ensure that the I/O we submitted to

View File

@@ -21,8 +21,8 @@ impl Schema {
Self { tables }
}
pub fn add_table(&mut self, name: &str, table: Table) {
let name = normalize_ident(name);
pub fn add_table(&mut self, table: Table) {
let name = normalize_ident(&table.name);
self.tables.insert(name, table);
}