From 01ea7386980c15316ccab74dceaa216e7182e7d3 Mon Sep 17 00:00:00 2001 From: Dominic Burkart Date: Wed, 31 May 2023 11:06:48 +0200 Subject: [PATCH] Use bool::then requested here: https://github.com/vectordotdev/vector/pull/17479#discussion_r1210860830 Co-authored-by: Bruce Guenter --- src/app.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/app.rs b/src/app.rs index 2ee85c2e2dca0..e599499afe3c9 100644 --- a/src/app.rs +++ b/src/app.rs @@ -62,13 +62,8 @@ impl ApplicationConfig { ) -> Result { let config_paths = opts.config_paths_with_formats(); - let graceful_shutdown_duration = if opts.no_graceful_shutdown_limit { - None - } else { - Some(Duration::from_secs(u64::from( - opts.graceful_shutdown_limit_secs, - ))) - }; + let graceful_shutdown_duration = (!opts.no_graceful_shutdown_limit) + .then(|| Duration::from_secs(u64::from(opts.graceful_shutdown_limit_secs))); let config = load_configs( &config_paths,