Skip to content

Commit 9482745

Browse files
committed
Config should be Sync + Send
1 parent d52650a commit 9482745

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

postgres/src/config.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ use tokio_postgres::{Error, Socket};
1313

1414
use crate::{Client, RUNTIME};
1515

16+
type DynExecutor = dyn Executor<Box<dyn Future<Item = (), Error = ()> + Send>> + Sync + Send;
17+
1618
#[derive(Clone)]
1719
pub struct Config {
1820
config: tokio_postgres::Config,
19-
#[allow(clippy::type_complexity)]
20-
executor: Option<Arc<dyn Executor<Box<dyn Future<Item = (), Error = ()> + Send>>>>,
21+
// this is an option since we don't want to boot up our default runtime unless we're actually going to use it.
22+
executor: Option<Arc<DynExecutor>>,
2123
}
2224

2325
impl fmt::Debug for Config {

0 commit comments

Comments
 (0)