Skip to content

Commit

Permalink
fix: misunderstanding vdf_serde resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
Tormak9970 committed Apr 6, 2023
1 parent 1061a23 commit 21ad742
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src-tauri/src/steam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub fn get_active_user(app_handle: AppHandle) -> u32 {
let loginusers_vdf = steam_root.join("config/loginusers.vdf");
let contents = fs::read_to_string(loginusers_vdf).unwrap();

let users = vdf_serde::from_str::<vdf_structs::LoginUsers>(&contents).unwrap().users;
let users = vdf_serde::from_str::<vdf_structs::users>(&contents).unwrap();

for (key, value) in users.into_iter() {
if value.MostRecent == "1" {
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/src/vdf_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ pub struct User {
}

#[derive(Serialize, Deserialize, Debug, PartialEq)]
pub struct LoginUsers {
#[allow(non_camel_case_types)]
pub struct users {
pub users: HashMap<String, User>
}

Expand Down

0 comments on commit 21ad742

Please sign in to comment.