Skip to content

Commit 01ea738

Browse files
Use bool::then
requested here: #17479 (comment) Co-authored-by: Bruce Guenter <[email protected]>
1 parent 15e2838 commit 01ea738

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/app.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,8 @@ impl ApplicationConfig {
6262
) -> Result<Self, ExitCode> {
6363
let config_paths = opts.config_paths_with_formats();
6464

65-
let graceful_shutdown_duration = if opts.no_graceful_shutdown_limit {
66-
None
67-
} else {
68-
Some(Duration::from_secs(u64::from(
69-
opts.graceful_shutdown_limit_secs,
70-
)))
71-
};
65+
let graceful_shutdown_duration = (!opts.no_graceful_shutdown_limit)
66+
.then(|| Duration::from_secs(u64::from(opts.graceful_shutdown_limit_secs)));
7267

7368
let config = load_configs(
7469
&config_paths,

0 commit comments

Comments
 (0)