mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-08-31 08:19:14 +00:00
fmt
This commit is contained in:
@@ -6,9 +6,9 @@ use std::{
|
||||
};
|
||||
|
||||
use anyhow::Context;
|
||||
use base64::{prelude::BASE64_STANDARD, Engine as _};
|
||||
use clap::builder::PossibleValue;
|
||||
use base64::{Engine as _, prelude::BASE64_STANDARD};
|
||||
use clap::ValueEnum;
|
||||
use clap::builder::PossibleValue;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use strum::{Display, EnumString, VariantArray};
|
||||
use tokio::io::AsyncReadExt as _;
|
||||
@@ -584,7 +584,12 @@ impl ConfigLoader for TomlConfigLoader {
|
||||
.filter(|h| !h.is_empty());
|
||||
|
||||
self.set_hostname(hostname.clone());
|
||||
hostname.unwrap_or_else(|| hostname::get().unwrap_or_default().to_string_lossy().into_owned())
|
||||
hostname.unwrap_or_else(|| {
|
||||
hostname::get()
|
||||
.unwrap_or_default()
|
||||
.to_string_lossy()
|
||||
.into_owned()
|
||||
})
|
||||
}
|
||||
|
||||
fn set_hostname(&self, name: Option<String>) {
|
||||
|
||||
@@ -6,7 +6,7 @@ use sha2::Sha256;
|
||||
use socket2::Protocol;
|
||||
use std::sync::RwLock;
|
||||
use std::{
|
||||
collections::{hash_map::DefaultHasher, HashMap},
|
||||
collections::{HashMap, hash_map::DefaultHasher},
|
||||
hash::Hasher,
|
||||
iter,
|
||||
net::{IpAddr, SocketAddr},
|
||||
@@ -15,11 +15,11 @@ use std::{
|
||||
};
|
||||
|
||||
use super::{
|
||||
PeerId,
|
||||
config::{ConfigLoader, Flags},
|
||||
netns::NetNS,
|
||||
network::IPCollector,
|
||||
stun::{StunInfoCollector, StunInfoCollectorTrait},
|
||||
PeerId,
|
||||
};
|
||||
#[cfg(feature = "magic-dns")]
|
||||
use crate::dns::{
|
||||
|
||||
Reference in New Issue
Block a user