aboutsummaryrefslogtreecommitdiffstats
path: root/mumlib/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mumlib/src/config.rs')
-rw-r--r--mumlib/src/config.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/mumlib/src/config.rs b/mumlib/src/config.rs
index e7d107a..ae569aa 100644
--- a/mumlib/src/config.rs
+++ b/mumlib/src/config.rs
@@ -1,11 +1,11 @@
+use crate::DEFAULT_PORT;
use serde::{Deserialize, Serialize};
use std::convert::TryFrom;
use std::fs;
+use std::net::{SocketAddr, ToSocketAddrs};
use std::path::Path;
use toml::value::Array;
use toml::Value;
-use std::net::{SocketAddr, ToSocketAddrs};
-use crate::DEFAULT_PORT;
#[derive(Debug, Deserialize, Serialize)]
struct TOMLConfig {
@@ -62,7 +62,10 @@ pub struct ServerConfig {
impl ServerConfig {
pub fn to_socket_addr(&self) -> Option<SocketAddr> {
- match (self.host.as_str(), self.port.unwrap_or(DEFAULT_PORT)).to_socket_addrs().map(|mut e| e.next()) {
+ match (self.host.as_str(), self.port.unwrap_or(DEFAULT_PORT))
+ .to_socket_addrs()
+ .map(|mut e| e.next())
+ {
Ok(Some(addr)) => Some(addr),
_ => None,
}