From fcadfa36958c55c5e9e377af6e3a9434816c3f9c Mon Sep 17 00:00:00 2001 From: Uddhav Dave Date: Tue, 21 Feb 2023 14:32:34 +0530 Subject: [PATCH 1/2] Version bump for openpgp-dsm --- Cargo.lock | 2 +- openpgp-dsm/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1815f5d0..4145ca4d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2070,7 +2070,7 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openpgp-dsm" -version = "1.1.0" +version = "1.2.0" dependencies = [ "anyhow", "bindgen", diff --git a/openpgp-dsm/Cargo.toml b/openpgp-dsm/Cargo.toml index 50cf9632..2dc3d07a 100644 --- a/openpgp-dsm/Cargo.toml +++ b/openpgp-dsm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openpgp-dsm" -version = "1.1.0" +version = "1.2.0" authors = ["zugzwang "] edition = "2018" From 9fc87eb78abc3a9af21d1a6fad3ee00f4f810d13 Mon Sep 17 00:00:00 2001 From: Uddhav Dave Date: Tue, 21 Feb 2023 14:37:20 +0530 Subject: [PATCH 2/2] removed unwrap in keymetadata impl --- openpgp-dsm/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openpgp-dsm/src/lib.rs b/openpgp-dsm/src/lib.rs index 8a4b106c..e6c36ef6 100644 --- a/openpgp-dsm/src/lib.rs +++ b/openpgp-dsm/src/lib.rs @@ -537,8 +537,9 @@ impl KeyMetadata { match serde_json::from_str(&dict[DSM_LABEL_PGP]) { Ok(key_md) => Ok(key_md), Err(e) => { - KeyMetadata::print_metadata_for_pre_0_3_0(&dict[DSM_LABEL_PGP]).unwrap(); - Err(anyhow::anyhow!("failed to read metadata: {:?}", e)) + KeyMetadata::print_metadata_for_pre_0_3_0(&dict[DSM_LABEL_PGP]) + .map_err(|e| anyhow::anyhow!("Failed to read metadata: {:?}", e))?; + Err(anyhow::anyhow!("Failed to parse Sobject: {:?}", e)) } }