Compare commits
No commits in common. "0a4a4019533fd84161726381ef31af482bc893d8" and "08103a08fc4803733fdfc65b91f0969648f9b997" have entirely different histories.
0a4a401953
...
08103a08fc
3 changed files with 3 additions and 5 deletions
|
@ -149,7 +149,6 @@ fn get_shortcuts(path: PathBuf) -> Result<Vec<NonSteamGame>, String> {
|
||||||
let vec: Result<Vec<NonSteamGame>, String> = vdf_map["shortcuts"]
|
let vec: Result<Vec<NonSteamGame>, String> = vdf_map["shortcuts"]
|
||||||
.clone()
|
.clone()
|
||||||
.into_vec()
|
.into_vec()
|
||||||
.map_or_else(|| Err("Malformed shortcuts.vdf".to_owned()), Ok)?
|
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|x| {
|
.map(|x| {
|
||||||
if let vdf::VdfValue::Dict(dict) = x {
|
if let vdf::VdfValue::Dict(dict) = x {
|
||||||
|
|
|
@ -21,7 +21,6 @@ impl HeuristicError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the Steam local directory
|
|
||||||
pub fn get_steamdir() -> Result<PathBuf, Box<dyn std::error::Error>> {
|
pub fn get_steamdir() -> Result<PathBuf, Box<dyn std::error::Error>> {
|
||||||
let mut dir = dirs::data_local_dir().unwrap_or_else(|| {
|
let mut dir = dirs::data_local_dir().unwrap_or_else(|| {
|
||||||
let mut dir = dirs::home_dir().unwrap();
|
let mut dir = dirs::home_dir().unwrap();
|
||||||
|
|
|
@ -28,12 +28,12 @@ pub enum VdfValue {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl VdfValue {
|
impl VdfValue {
|
||||||
pub fn into_vec(self) -> Option<Vec<VdfValue>> {
|
pub fn into_vec(self) -> Vec<VdfValue> {
|
||||||
if let VdfValue::Dict(dict) = self {
|
if let VdfValue::Dict(dict) = self {
|
||||||
// lazily assuming this is an array of strings
|
// lazily assuming this is an array of strings
|
||||||
Some(dict.into_values().collect())
|
dict.into_values().collect()
|
||||||
} else {
|
} else {
|
||||||
None
|
panic!("Not a Dict! (maybe this should be less brutal of error mgmt!)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue