mirror of
https://github.com/timvisee/lazymc.git
synced 2025-07-25 17:21:59 -07:00
Resolve clippy warnings
This commit is contained in:
@@ -208,13 +208,9 @@ impl Server {
|
||||
///
|
||||
/// This does not check whether it exists.
|
||||
pub fn server_directory(config: &Config) -> Option<PathBuf> {
|
||||
if config.server.directory.is_none() {
|
||||
return None;
|
||||
}
|
||||
|
||||
// Get directory, relative to config directory if known
|
||||
match config.path.as_ref().and_then(|p| p.parent()) {
|
||||
Some(config_dir) => Some(config_dir.join(config.server.directory.as_ref().unwrap())),
|
||||
Some(config_dir) => Some(config_dir.join(config.server.directory.as_ref()?)),
|
||||
None => config.server.directory.clone(),
|
||||
}
|
||||
}
|
||||
|
@@ -508,7 +508,7 @@ async fn stop_server_rcon(config: &Config, server: &Server) -> bool {
|
||||
}
|
||||
|
||||
// Create RCON client
|
||||
let mut rcon = match Rcon::connect_config(&config).await {
|
||||
let mut rcon = match Rcon::connect_config(config).await {
|
||||
Ok(rcon) => rcon,
|
||||
Err(err) => {
|
||||
error!(target: "lazymc", "Failed to RCON server to sleep: {}", err);
|
||||
|
@@ -238,7 +238,7 @@ async fn server_status(client_info: &ClientInfo, config: &Config, server: &Serve
|
||||
favicon = status.as_ref().unwrap().favicon.clone()
|
||||
}
|
||||
if favicon.is_none() {
|
||||
favicon = Some(server_favicon(&config).await);
|
||||
favicon = Some(server_favicon(config).await);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user