mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Clippy fixes for windows specific code (#319)
* Clippy fixes for windows specific code * Remove unwraps in windows code * Fix compile error on unix
This commit is contained in:
@@ -85,12 +85,14 @@ pub fn get_default_location() -> String {
|
||||
#[cfg(target_os = "windows")]
|
||||
pub fn get_default_location() -> String {
|
||||
let key = "APPDATA";
|
||||
let appdata = std::env::var(key).expect("Expected a APPDATA variable to be defined");
|
||||
Path::new(&appdata)
|
||||
.join("itch")
|
||||
.to_str()
|
||||
.unwrap()
|
||||
.to_string()
|
||||
std::env::var(key)
|
||||
.map(|appdata| {
|
||||
Path::new(&appdata)
|
||||
.join("itch")
|
||||
.to_string_lossy()
|
||||
.to_string()
|
||||
})
|
||||
.unwrap_or_default()
|
||||
//C:\Users\phili\AppData\Local\itch
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user