diff --git a/client/src/main.rs b/client/src/main.rs index 67cbf1a..3a26ffa 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -1002,14 +1002,14 @@ fn override_endpoint( sub_opts: OverrideEndpointOpts, ) -> Result<(), Error> { let config = InterfaceConfig::from_interface(&opts.config_dir, interface)?; - let port = match config.interface.listen_port { - Some(port) => port, - None => bail!("you need to set a listen port with set-listen-port before overriding the endpoint (otherwise port randomization on the interface would make it useless).") - }; let endpoint_contents = if sub_opts.unset { prompts::unset_override_endpoint(&sub_opts)?.then_some(EndpointContents::Unset) } else { + let port = match config.interface.listen_port { + Some(port) => port, + None => bail!("you need to set a listen port with set-listen-port before overriding the endpoint (otherwise port randomization on the interface would make it useless).") + }; let endpoint = prompts::override_endpoint(&sub_opts, port)?; endpoint.map(EndpointContents::Set) }; diff --git a/hostsfile/src/lib.rs b/hostsfile/src/lib.rs index b8844a2..44de3c3 100644 --- a/hostsfile/src/lib.rs +++ b/hostsfile/src/lib.rs @@ -12,6 +12,7 @@ use std::{ pub type Result = result::Result>; /// A custom error struct for this crate. +#[allow(dead_code)] #[derive(Debug, Clone)] pub struct Error(String);