Display default value for --maximum-resolution-timeout in help

This commit is contained in:
Jiahao XU 2024-08-03 05:44:08 +00:00
parent 51738a923c
commit c596b845c3
2 changed files with 6 additions and 6 deletions

View file

@ -191,9 +191,10 @@ pub struct Args {
#[clap( #[clap(
help_heading = "Overrides", help_heading = "Overrides",
long, long,
env = "BINSTALL_MAXIMUM_RESOLUTION_TIMEOUT" env = "BINSTALL_MAXIMUM_RESOLUTION_TIMEOUT",
default_value_t = NonZeroU16::new(180).unwrap(),
)] )]
pub(crate) maximum_resolution_timeout: Option<NonZeroU16>, pub(crate) maximum_resolution_timeout: NonZeroU16,
/// This flag is now enabled by default thus a no-op. /// This flag is now enabled by default thus a no-op.
/// ///

View file

@ -210,10 +210,9 @@ pub fn install_crates(
}, },
disable_telemetry: args.disable_telemetry, disable_telemetry: args.disable_telemetry,
maximum_resolution_timeout: args maximum_resolution_timeout: Duration::from_secs(
.maximum_resolution_timeout args.maximum_resolution_timeout.get().into(),
.map(|n| Duration::from_secs(n.get().into())) ),
.unwrap_or(Duration::from_secs(180)),
}); });
// Destruct args before any async function to reduce size of the future // Destruct args before any async function to reduce size of the future