From b905f46534faba108f92f81ff9bb2fc63b9cc9ee Mon Sep 17 00:00:00 2001 From: "Michael P. Jung" Date: Thu, 14 Nov 2019 13:48:04 +0100 Subject: [PATCH] Fix build without postgres feature --- src/bin/bench_postgres.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bin/bench_postgres.rs b/src/bin/bench_postgres.rs index 47036580..0ce51aa2 100644 --- a/src/bin/bench_postgres.rs +++ b/src/bin/bench_postgres.rs @@ -1,6 +1,5 @@ -#[tokio::main] #[cfg(feature = "postgres")] -async fn main() { +async fn bench_postgres() { use std::env; use std::time::{Instant}; use deadpool::Pool; @@ -50,3 +49,9 @@ async fn main() { println!("Speedup: {}%", 100 * d1.as_millis() / d2.as_millis()); assert!(d1 > d2); } + +#[tokio::main] +async fn main() { + #[cfg(feature = "postgres")] + bench_postgres().await; +}