diff --git a/Cargo.toml b/Cargo.toml index 3829de92..9b9b0cfc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,8 +53,8 @@ walkdir = { version = "2.3.3", optional = true } walkdir = "2.3.3" [features] -default = [] -compare = [] +default = ["compare", "foreign_document_test"] +compare = ["dep:tokio"] foreign_document_test = ["compare", "dep:tokio", "dep:futures", "tokio/sync", "dep:walkdir"] tracing = ["dep:opentelemetry", "dep:opentelemetry-otlp", "dep:opentelemetry-semantic-conventions", "dep:tokio", "dep:tracing", "dep:tracing-opentelemetry", "dep:tracing-subscriber"] diff --git a/src/bin_compare.rs b/src/bin_compare.rs index 655aa7dc..40f0991c 100644 --- a/src/bin_compare.rs +++ b/src/bin_compare.rs @@ -14,7 +14,12 @@ mod init_tracing; #[cfg(not(feature = "tracing"))] fn main() -> Result<(), Box> { - main_body() + let rt = tokio::runtime::Runtime::new()?; + let result = rt.block_on(async { + let main_body_result = main_body().await; + main_body_result + }); + result } #[cfg(feature = "tracing")] @@ -30,7 +35,7 @@ fn main() -> Result<(), Box> { } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -fn main_body() -> Result<(), Box> { +async fn main_body() -> Result<(), Box> { let args = std::env::args().skip(1); if args.is_empty() { let org_contents = read_stdin_to_string()?;