Clean up some commented code

This commit is contained in:
Timothy Warren 2019-04-25 13:17:42 -04:00
parent e123f5b96b
commit 9d71dc641d
4 changed files with 2 additions and 24 deletions

View File

@ -39,10 +39,6 @@ impl DefaultDriver {
} }
impl DatabaseDriver for DefaultDriver { impl DatabaseDriver for DefaultDriver {
// fn query(&self, sql: &str) -> Result<(), ()> {
// Ok(())
// }
fn explain(&self, sql: &str) -> String { fn explain(&self, sql: &str) -> String {
format!("EXPLAIN {}", sql) format!("EXPLAIN {}", sql)
} }
@ -83,10 +79,8 @@ pub trait DatabaseDriver {
if identifier.contains(",") { if identifier.contains(",") {
// This was the only way I could figure to get // This was the only way I could figure to get
// around mutable string reference scope hell // around mutable string reference scope hell
identifier.replace_range( let func = |part| self.quote_identifier(part.trim());
.., identifier.replace_range(.., &split_map_join(identifier, ",", func));
&split_map_join(identifier, ",", |part| self.quote_identifier(part.trim())),
);
} }
let (open_char, close_char) = self._quotes(); let (open_char, close_char) = self._quotes();

View File

@ -24,10 +24,6 @@ impl DatabaseDriver for MSSQL {
('[', ']') ('[', ']')
} }
// fn query(&self, sql: &str) -> Result<(), ()> {
// unimplemented!();
// }
fn explain(&self, sql: &str) -> String { fn explain(&self, sql: &str) -> String {
sql.to_string() sql.to_string()
} }

View File

@ -23,10 +23,6 @@ impl DatabaseDriver for MySQLDriver {
('`', '`') ('`', '`')
} }
// fn query(&self, sql: &str) -> Result<(), ()> {
// unimplemented!();
// }
fn limit(&self, sql: &str, limit: Option<usize>, offset: Option<usize>) -> String { fn limit(&self, sql: &str, limit: Option<usize>, offset: Option<usize>) -> String {
if limit.is_none() { if limit.is_none() {
return sql.to_string(); return sql.to_string();

View File

@ -36,17 +36,9 @@ impl SQLiteDriver {
self.connection = RefCell::new(Some(connection)); self.connection = RefCell::new(Some(connection));
} }
// pub fn query(&self, sql: &str) -> Result<usize> {
//
// }
} }
impl DatabaseDriver for SQLiteDriver { impl DatabaseDriver for SQLiteDriver {
// fn query(&self, sql: &str) -> Result<(), ()> {
// unimplemented!();
// }
fn explain(&self, sql: &str) -> String { fn explain(&self, sql: &str) -> String {
format!("EXPLAIN QUERY PLAN {}", sql) format!("EXPLAIN QUERY PLAN {}", sql)
} }