From 9d71dc641d90eee33a91d284eea7115a922df0cc Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 25 Apr 2019 13:17:42 -0400 Subject: [PATCH] Clean up some commented code --- src/drivers.rs | 10 ++-------- src/drivers/mssql.rs | 4 ---- src/drivers/mysql.rs | 4 ---- src/drivers/sqlite.rs | 8 -------- 4 files changed, 2 insertions(+), 24 deletions(-) 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) }