mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-30 14:34:22 +01:00
Merge pull request #79 from haaawk/schema_add_table
Remove unneeded clone in add_table
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user