meta: make clippy happy
parent
e166619883
commit
426916fadd
|
@ -143,13 +143,11 @@ pub fn init_wizard(conf: &ServerConfig, opts: InitializeOpts) -> Result<(), Erro
|
|||
|
||||
let endpoint: Endpoint = if let Some(endpoint) = opts.external_endpoint {
|
||||
endpoint
|
||||
} else if opts.auto_external_endpoint {
|
||||
let ip = publicip::get_any(Preference::Ipv4)?.ok_or("couldn't get external IP")?;
|
||||
SocketAddr::new(ip, 51820).into()
|
||||
} else {
|
||||
if opts.auto_external_endpoint {
|
||||
let ip = publicip::get_any(Preference::Ipv4)?.ok_or("couldn't get external IP")?;
|
||||
SocketAddr::new(ip, 51820).into()
|
||||
} else {
|
||||
prompts::ask_endpoint()?
|
||||
}
|
||||
prompts::ask_endpoint()?
|
||||
};
|
||||
|
||||
let listen_port: u16 = if let Some(listen_port) = opts.listen_port {
|
||||
|
|
|
@ -204,7 +204,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
if let Err(e) = initialize::init_wizard(&conf, opts) {
|
||||
println!("{}: {}.", "creation failed".red(), e);
|
||||
}
|
||||
},
|
||||
}
|
||||
Command::Uninstall { interface } => uninstall(&interface, &conf)?,
|
||||
Command::Serve { interface } => serve(*interface, &conf).await?,
|
||||
Command::AddPeer { interface, args } => add_peer(&interface, &conf, args)?,
|
||||
|
@ -402,8 +402,8 @@ async fn serve(interface: InterfaceName, conf: &ServerConfig) -> Result<(), Erro
|
|||
|
||||
let context = Context {
|
||||
db,
|
||||
interface,
|
||||
endpoints,
|
||||
interface,
|
||||
public_key,
|
||||
};
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ pub fn ensure_dirs_exist(dirs: &[&Path]) -> Result<(), WrappedIoError> {
|
|||
for dir in dirs {
|
||||
match fs::create_dir(dir).with_path(dir) {
|
||||
Err(e) if e.kind() != io::ErrorKind::AlreadyExists => {
|
||||
return Err(e.into());
|
||||
return Err(e);
|
||||
}
|
||||
_ => {
|
||||
let target_file = File::open(dir).with_path(dir)?;
|
||||
|
|
Loading…
Reference in New Issue