mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
Fix formatting
This commit is contained in:
parent
fae780f754
commit
fb6a50edd3
1 changed files with 9 additions and 7 deletions
|
@ -9,12 +9,8 @@ use std::{
|
|||
backtrace, fs,
|
||||
fs::File,
|
||||
io::{self, BufWriter},
|
||||
net::{Ipv4Addr, SocketAddr, SocketAddrV4},
|
||||
panic,
|
||||
net::{
|
||||
SocketAddr,
|
||||
SocketAddrV4,
|
||||
Ipv4Addr,
|
||||
},
|
||||
};
|
||||
use tracing::{error, info, level_filters::LevelFilter};
|
||||
use tracing_subscriber::EnvFilter;
|
||||
|
@ -90,9 +86,15 @@ async fn main() {
|
|||
None
|
||||
} else {
|
||||
// allows binding to both IPv6 and IPv4
|
||||
host.parse::<SocketAddr>().ok()
|
||||
host.parse::<SocketAddr>()
|
||||
.ok()
|
||||
// compatibility with providing only the port (which then proceeds to bind to IPv4 only)
|
||||
.or_else(|| Some(SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::UNSPECIFIED, host.parse().ok()?))))
|
||||
.or_else(|| {
|
||||
Some(SocketAddr::V4(SocketAddrV4::new(
|
||||
Ipv4Addr::UNSPECIFIED,
|
||||
host.parse().ok()?,
|
||||
)))
|
||||
})
|
||||
.map(Some)
|
||||
.expect("host argument is neither SocketAddr nor port")
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue