refactor: apply clippy auto-fixes (162 warnings resolved)
- Fix needless borrows and references - Collapse nested if statements - Replace manual strip_prefix with str::strip_prefix() - Remove redundant closures in map/unwrap_or_else - Use Iterator::next_back() instead of rev().next() - Simplify map_or patterns - Use std::io::Error::other() instead of new(ErrorKind::Other, ..) - Use div_ceil() instead of manual ceiling division - Consolidate format! string arguments - Various other idiomatic Rust improvements 39 files changed, 220 insertions(+), 320 deletions(-)
This commit is contained in:
@@ -73,8 +73,7 @@ pub async fn create_database_pool(config: &AppConfig) -> Result<PgPool> {
|
||||
async fn tables_exist(pool: &PgPool) -> bool {
|
||||
sqlx::query("SELECT EXISTS (SELECT 1 FROM pg_tables WHERE schemaname = 'auth' AND tablename = 'users')")
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.and_then(|row| Ok(row.get::<bool, _>(0)))
|
||||
.await.map(|row| row.get::<bool, _>(0))
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user