Skip to content

Commit

Permalink
Use bool::then
Browse files Browse the repository at this point in the history
requested here: #17479 (comment)

Co-authored-by: Bruce Guenter <bruce.guenter@datadoghq.com>
  • Loading branch information
DominicBurkart and bruceg committed May 31, 2023
1 parent 15e2838 commit 01ea738
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,8 @@ impl ApplicationConfig {
) -> Result<Self, ExitCode> {
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,
Expand Down

0 comments on commit 01ea738

Please sign in to comment.