diff --git a/src/drivers.rs b/src/drivers.rs index 2501e09..de41b0c 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -39,10 +39,6 @@ impl DefaultDriver { } impl DatabaseDriver for DefaultDriver { -// fn query(&self, sql: &str) -> Result<(), ()> { -// Ok(()) -// } - fn explain(&self, sql: &str) -> String { format!("EXPLAIN {}", sql) } @@ -83,10 +79,8 @@ pub trait DatabaseDriver { if identifier.contains(",") { // This was the only way I could figure to get // around mutable string reference scope hell - identifier.replace_range( - .., - &split_map_join(identifier, ",", |part| self.quote_identifier(part.trim())), - ); + let func = |part| self.quote_identifier(part.trim()); + identifier.replace_range(.., &split_map_join(identifier, ",", func)); } let (open_char, close_char) = self._quotes(); diff --git a/src/drivers/mssql.rs b/src/drivers/mssql.rs index 1592c53..d4e91e5 100644 --- a/src/drivers/mssql.rs +++ b/src/drivers/mssql.rs @@ -24,10 +24,6 @@ impl DatabaseDriver for MSSQL { ('[', ']') } -// fn query(&self, sql: &str) -> Result<(), ()> { -// unimplemented!(); -// } - fn explain(&self, sql: &str) -> String { sql.to_string() } diff --git a/src/drivers/mysql.rs b/src/drivers/mysql.rs index e46ad36..70bbe27 100644 --- a/src/drivers/mysql.rs +++ b/src/drivers/mysql.rs @@ -23,10 +23,6 @@ impl DatabaseDriver for MySQLDriver { ('`', '`') } -// fn query(&self, sql: &str) -> Result<(), ()> { -// unimplemented!(); -// } - fn limit(&self, sql: &str, limit: Option, offset: Option) -> String { if limit.is_none() { return sql.to_string(); diff --git a/src/drivers/sqlite.rs b/src/drivers/sqlite.rs index bc84e48..5150be4 100644 --- a/src/drivers/sqlite.rs +++ b/src/drivers/sqlite.rs @@ -36,17 +36,9 @@ impl SQLiteDriver { self.connection = RefCell::new(Some(connection)); } - -// pub fn query(&self, sql: &str) -> Result { -// -// } } impl DatabaseDriver for SQLiteDriver { -// fn query(&self, sql: &str) -> Result<(), ()> { -// unimplemented!(); -// } - fn explain(&self, sql: &str) -> String { format!("EXPLAIN QUERY PLAN {}", sql) }