From 7144ebc8a0d16150afad56520a795ee23e039721 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Sun, 10 Jan 2021 11:33:55 -0800 Subject: [PATCH] style: clippy --- sqlx-core/src/acquire.rs | 1 + sqlx-core/src/runtime.rs | 9 +++++---- sqlx-mysql/src/connection.rs | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sqlx-core/src/acquire.rs b/sqlx-core/src/acquire.rs index 6abe5b5a..384b3006 100644 --- a/sqlx-core/src/acquire.rs +++ b/sqlx-core/src/acquire.rs @@ -3,6 +3,7 @@ use futures_util::future::BoxFuture; use crate::{Database, Runtime}; +#[allow(clippy::type_complexity)] pub trait Acquire { type Database: Database; diff --git a/sqlx-core/src/runtime.rs b/sqlx-core/src/runtime.rs index 260b6996..9f7f4925 100644 --- a/sqlx-core/src/runtime.rs +++ b/sqlx-core/src/runtime.rs @@ -84,11 +84,11 @@ impl Runtime for () { type TcpStream = (); } +// pick a default runtime +// this is so existing applications in SQLx pre 0.6 work and to +// make it more convenient, if your application only uses 1 runtime (99%+) +// most of the time you won't have to worry about picking the runtime mod default { - // pick a default runtime - // this is so existing applications in SQLx pre 0.6 work and to - // make it more convenient, if your application only uses 1 runtime (99%+) - // most of the time you won't have to worry about picking the runtime #[cfg(feature = "async-std")] pub type Runtime = super::AsyncStd; @@ -146,4 +146,5 @@ mod default { /// .connect().await?; // for Async runtimes /// ``` /// +#[allow(clippy::module_name_repetitions)] pub type DefaultRuntime = default::Runtime; diff --git a/sqlx-mysql/src/connection.rs b/sqlx-mysql/src/connection.rs index f596a660..c6c09dd5 100644 --- a/sqlx-mysql/src/connection.rs +++ b/sqlx-mysql/src/connection.rs @@ -116,7 +116,7 @@ where where for<'s> ::TcpStream: sqlx_core::blocking::io::Stream<'s, Rt>, { - >::ping(self) + self.ping() } }