diff --git a/core/lib.rs b/core/lib.rs index 3263cfe42..1bf93a5cb 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -71,7 +71,7 @@ impl Database { let root_page: i64 = row.get::(3)?; let sql: String = row.get::(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 diff --git a/core/schema.rs b/core/schema.rs index 3e48b2208..a8982dd77 100644 --- a/core/schema.rs +++ b/core/schema.rs @@ -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); }