From 1a86d7d35475c3511c3eed5f1da12be269869837 Mon Sep 17 00:00:00 2001 From: Mohammad Banisaeid Date: Sun, 23 Jun 2024 17:52:50 +0200 Subject: [PATCH] Handle products without a `human_name` (#43) * Handle products without human_name * Bump version to 0.15.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 2 +- src/models.rs | 5 +---- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cf9e52f..9b8ecb4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -642,7 +642,7 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "humble-cli" -version = "0.14.1" +version = "0.15.0" dependencies = [ "anyhow", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index fbbf086..54d6319 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "humble-cli" authors = ["Mohammad Banisaeid "] -version = "0.14.1" +version = "0.15.0" license = "MIT" description = "The missing CLI for downloading your Humble Bundle purchases" documentation = "https://github.com/smbl64/humble-cli" diff --git a/README.md b/README.md index c36df79..d6bff6a 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ After that you will have access to the following sub-commands: ``` $ humble-cli --help -humble-cli 0.14.1 +humble-cli 0.15.0 The missing Humble Bundle CLI USAGE: diff --git a/src/models.rs b/src/models.rs index bc3b705..e5c3461 100644 --- a/src/models.rs +++ b/src/models.rs @@ -75,10 +75,7 @@ impl Bundle { let mut result = vec![]; for tpk in tpks { let redeemed = tpk["redeemed_key_val"].is_string(); - let human_name = tpk["human_name"] - .as_str() - .expect("expected human_name to be a string") - .to_owned(); + let human_name = tpk["human_name"].as_str().unwrap_or("").to_owned(); result.push(ProductKey { redeemed,