Skip to content

Commit

Permalink
Placate clippy on more platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmicHorrorDev committed Nov 24, 2023
1 parent a266474 commit 698d9a2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,20 +267,17 @@ impl SteamDir {
let install_path_str: String = installation_regkey.get_value("InstallPath").ok()?;

let install_path = PathBuf::from(install_path_str);
install_path.is_dir().then(|| install_path)
install_path.is_dir().then_some(install_path)
}

#[cfg(target_os = "macos")]
fn locate_steam_dir() -> Option<PathBuf> {
// Steam's installation location is pretty easy to find on macOS, as it's always in $USER/Library/Application Support
let home_dir = match dirs::home_dir() {
Some(home_dir) => home_dir,
None => return None,
};
let home_dir = dirs::home_dir()?;

// Find Library/Application Support/Steam
let install_path = home_dir.join("Library/Application Support/Steam");
install_path.is_dir().then(|| install_path)
install_path.is_dir().then_some(install_path)
}

#[cfg(target_os = "linux")]
Expand Down

0 comments on commit 698d9a2

Please sign in to comment.