Fixup warnings

This commit is contained in:
Steven Fackler 2019-03-24 13:32:29 -07:00
parent 60825d9bef
commit d52650a55c
2 changed files with 6 additions and 3 deletions

View File

@ -16,7 +16,8 @@ use crate::{Client, RUNTIME};
#[derive(Clone)] #[derive(Clone)]
pub struct Config { pub struct Config {
config: tokio_postgres::Config, config: tokio_postgres::Config,
executor: Option<Arc<Executor<Box<Future<Item = (), Error = ()> + Send>>>>, #[allow(clippy::type_complexity)]
executor: Option<Arc<dyn Executor<Box<dyn Future<Item = (), Error = ()> + Send>>>>,
} }
impl fmt::Debug for Config { impl fmt::Debug for Config {
@ -118,7 +119,7 @@ impl Config {
pub fn executor<E>(&mut self, executor: E) -> &mut Config pub fn executor<E>(&mut self, executor: E) -> &mut Config
where where
E: Executor<Box<Future<Item = (), Error = ()> + Send>> + 'static + Sync + Send, E: Executor<Box<dyn Future<Item = (), Error = ()> + Send>> + 'static + Sync + Send,
{ {
self.executor = Some(Arc::new(executor)); self.executor = Some(Arc::new(executor));
self self
@ -149,7 +150,7 @@ impl Config {
fn with_executor<F, T>(&self, f: F) -> T fn with_executor<F, T>(&self, f: F) -> T
where where
F: FnOnce(&Executor<Box<Future<Item = (), Error = ()> + Send>>) -> T, F: FnOnce(&dyn Executor<Box<dyn Future<Item = (), Error = ()> + Send>>) -> T,
{ {
match &self.executor { match &self.executor {
Some(e) => f(&**e), Some(e) => f(&**e),

View File

@ -1,3 +1,5 @@
#![warn(clippy::all, rust_2018_idioms)]
#[cfg(feature = "runtime")] #[cfg(feature = "runtime")]
use lazy_static::lazy_static; use lazy_static::lazy_static;
#[cfg(feature = "runtime")] #[cfg(feature = "runtime")]