[PR Feedback] Be more explicit setting up platform-specific options
@@ -1342,11 +1342,11 @@ fn maybe_add_configurable_shutdown_options(mut app: App<'static, 'static>,
.long("shutdown-signal")
.takes_value(true)
.default_value(&SHUTDOWN_SIGNAL_DEFAULT));
- app = add_shutdown_timeout_option(app);
- }
-
+ add_shutdown_timeout_option(app)
+ } else {
app
}
+}
#[cfg(windows)]
fn maybe_add_configurable_shutdown_options(mut app: App<'static, 'static>,
@@ -1355,10 +1355,11 @@ fn maybe_add_configurable_shutdown_options(mut app: App<'static, 'static>,
// Identical to the Unix implementation, but does not include the
// SHUTDOWN_SIGNAL option, since that doesn't exist on Windows
if feature_flags.contains(FeatureFlag::CONFIGURE_SHUTDOWN) {
- app = add_shutdown_timeout_option(app);
- }
+ add_shutdown_timeout_option(app)
+ } else {
app
}
+}
fn add_shutdown_timeout_option(app: App<'static, 'static>) -> App<'static, 'static> {
app.arg(Arg::with_name("SHUTDOWN_TIMEOUT").help("The number of seconds after sending a \
