Apply more suggestions.

This commit is contained in:
Tom Alexander
2023-10-16 19:12:25 -04:00
parent acd24d6198
commit 9a4d290cf8
6 changed files with 28 additions and 43 deletions

View File

@@ -15,23 +15,21 @@ mod init_tracing;
#[cfg(not(feature = "tracing"))]
fn main() -> Result<(), Box<dyn std::error::Error>> {
let rt = tokio::runtime::Runtime::new()?;
let result = rt.block_on(async {
rt.block_on(async {
let main_body_result = main_body().await;
main_body_result
});
result
})
}
#[cfg(feature = "tracing")]
fn main() -> Result<(), Box<dyn std::error::Error>> {
let rt = tokio::runtime::Runtime::new()?;
let result = rt.block_on(async {
rt.block_on(async {
init_telemetry()?;
let main_body_result = main_body().await;
shutdown_telemetry()?;
main_body_result
});
result
})
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]