cargo clippy is angry

This commit is contained in:
[object Object]
2022-12-28 12:03:00 -08:00
parent 716cd48eac
commit d3cb880dd0
4 changed files with 6 additions and 17 deletions

View File

@@ -478,19 +478,13 @@ impl Default for Advanced {
} }
/// Config configuration. /// Config configuration.
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize, Default)]
#[serde(default)] #[serde(default)]
pub struct ConfigConfig { pub struct ConfigConfig {
/// Configuration for lazymc version. /// Configuration for lazymc version.
pub version: Option<String>, pub version: Option<String>,
} }
impl Default for ConfigConfig {
fn default() -> Self {
Self { version: None }
}
}
fn option_pathbuf_dot() -> Option<PathBuf> { fn option_pathbuf_dot() -> Option<PathBuf> {
Some(".".into()) Some(".".into())
} }

View File

@@ -114,7 +114,7 @@ fn rewrite_contents(contents: String, mut changes: HashMap<&str, String>) -> Opt
} }
// Try to split property // Try to split property
let (key, value) = match line.split_once("=") { let (key, value) = match line.split_once('=') {
Some(result) => result, Some(result) => result,
None => return line, None => return line,
}; };

View File

@@ -157,11 +157,7 @@ async fn connect_to_server_no_timeout(
// Select server address to use, add magic if Forge // Select server address to use, add magic if Forge
let server_addr = if config.server.forge { let server_addr = if config.server.forge {
format!( format!("{}{}", config.server.address.ip(), forge::STATUS_MAGIC,)
"{}{}",
config.server.address.ip().to_string(),
forge::STATUS_MAGIC,
)
} else { } else {
config.server.address.ip().to_string() config.server.address.ip().to_string()
}; };

View File

@@ -151,10 +151,9 @@ fn reload_whitelist(config: &Config, server: &Server, dir: &Path) {
} }
// Must be enabled in server.properties // Must be enabled in server.properties
let enabled = let enabled = server_properties::read_property(dir.join(server_properties::FILE), "white-list")
server_properties::read_property(&dir.join(server_properties::FILE), "white-list") .map(|v| v.trim() == "true")
.map(|v| v.trim() == "true") .unwrap_or(false);
.unwrap_or(false);
if !enabled { if !enabled {
server.set_whitelist_blocking(None); server.set_whitelist_blocking(None);
debug!(target: "lazymc", "Not using whitelist, not enabled in {}", server_properties::FILE); debug!(target: "lazymc", "Not using whitelist, not enabled in {}", server_properties::FILE);