Skip to content

Commit

Permalink
Resolve clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
timvisee committed Nov 24, 2021
1 parent 9e08ed6 commit 6b23490
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 6b23490

Please sign in to comment.