summaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2018-01-14 22:34:38 +0100
committerNeal H. Walfield <neal@pep.foundation>2018-01-14 22:36:44 +0100
commit944b8500526e70d3631b8f36650752c48cbdcb2f (patch)
treead03101a8b25a3450082816167b4bdf83d2d8d05 /tool
parent5d69d7b36830c2a43a05b4527998f860afd2aa4d (diff)
openpgp: Remove the openpgp/types module
- It only contains a KeyId type which is redundant relative to KeyID and it is buggy (e.g., when it converts a Key ID to hex, it drops any leading zeros). - Update users to use KeyID instead.
Diffstat (limited to 'tool')
-rw-r--r--tool/src/main.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/tool/src/main.rs b/tool/src/main.rs
index 0df05a36..b7e91ca2 100644
--- a/tool/src/main.rs
+++ b/tool/src/main.rs
@@ -250,11 +250,14 @@ fn real_main() -> Result<()> {
match m.subcommand() {
("get", Some(m)) => {
let keyid = m.value_of("keyid").unwrap();
- let id = openpgp::types::KeyId::from_hex(keyid);
+ let id = openpgp::KeyID::from_hex(keyid);
if id.is_none() {
- eprintln!("Malformed keyid: {:?}", keyid);
+ eprintln!("Malformed key ID: \"{:?}\"\n\
+ (Note: only long Key IDs are supported.)",
+ keyid);
exit(1);
}
+ let id = id.unwrap();
let mut output = create_or_stdout(m.value_of("output"));
let mut output = if m.is_present("armor") {
@@ -263,7 +266,7 @@ fn real_main() -> Result<()> {
output
};
- ks.get(&id.unwrap()).expect("An error occured")
+ ks.get(&id).expect("An error occured")
.serialize(&mut output).expect("An error occured");
},
("send", Some(m)) => {