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)]
pub struct 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 {
@ -118,7 +119,7 @@ impl Config {
pub fn executor<E>(&mut self, executor: E) -> &mut Config
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
@ -149,7 +150,7 @@ impl Config {
fn with_executor<F, T>(&self, f: F) -> T
where
F: FnOnce(&Executor<Box<Future<Item = (), Error = ()> + Send>>) -> T,
F: FnOnce(&dyn Executor<Box<dyn Future<Item = (), Error = ()> + Send>>) -> T,
{
match &self.executor {
Some(e) => f(&**e),

View File

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