From e1ae7d0f9add3e76978929a2e9dc98c8991cb394 Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Sat, 7 Aug 2021 00:58:09 +0900 Subject: [PATCH] fix clippy warnings --- src/database/mysql.rs | 6 +----- src/database/postgres.rs | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/database/mysql.rs b/src/database/mysql.rs index 4efdffa..00a1f74 100644 --- a/src/database/mysql.rs +++ b/src/database/mysql.rs @@ -31,11 +31,7 @@ impl Pool for MySqlPool { for db in databases { list.push(Database::new( db.clone(), - self.get_tables(db.clone()) - .await? - .into_iter() - .map(|table| table.into()) - .collect(), + self.get_tables(db.clone()).await?, )) } Ok(list) diff --git a/src/database/postgres.rs b/src/database/postgres.rs index c97163f..d1ae948 100644 --- a/src/database/postgres.rs +++ b/src/database/postgres.rs @@ -85,7 +85,7 @@ impl Pool for PostgresPool { database = database.name, table = table.name, filter = filter, - table_schema = table.schema.clone().unwrap_or("public".to_string()), + table_schema = table.schema.clone().unwrap_or_else(|| "public".to_string()), page = page, limit = RECORDS_LIMIT_PER_PAGE ) @@ -94,7 +94,7 @@ impl Pool for PostgresPool { r#"SELECT * FROM "{database}"."{table_schema}"."{table}" limit {limit} offset {page}"#, database = database.name, table = table.name, - table_schema = table.schema.clone().unwrap_or("public".to_string()), + table_schema = table.schema.clone().unwrap_or_else(|| "public".to_string()), page = page, limit = RECORDS_LIMIT_PER_PAGE )