diff options
author | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2020-03-20 15:14:05 +0100 |
---|---|---|
committer | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2020-03-20 15:36:58 +0100 |
commit | 857845f523ab090638693d5498c8753e1e41cf36 (patch) | |
tree | 589fe471f65f98f3438633d83894fb160aa04f6f /openpgp-ffi/src | |
parent | 8905aabfa245754426bd67ba5319024e61fc39db (diff) |
openpgp: Remove `to_hex` in KeyHandle, KeyID and Fingerprint.
- Replace all usages of `to_hex` with formatting string with :X
specifier.
- Fixes #456.
Diffstat (limited to 'openpgp-ffi/src')
-rw-r--r-- | openpgp-ffi/src/fingerprint.rs | 2 | ||||
-rw-r--r-- | openpgp-ffi/src/keyid.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/openpgp-ffi/src/fingerprint.rs b/openpgp-ffi/src/fingerprint.rs index 549311b5..86bb7d21 100644 --- a/openpgp-ffi/src/fingerprint.rs +++ b/openpgp-ffi/src/fingerprint.rs @@ -92,7 +92,7 @@ fn pgp_fingerprint_as_bytes(fp: *const Fingerprint, #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_fingerprint_to_hex(fp: *const Fingerprint) -> *mut c_char { - ffi_return_string!(fp.ref_raw().to_hex()) + ffi_return_string!(format!("{:X}", fp.ref_raw())) } /// Converts the fingerprint to a key ID. diff --git a/openpgp-ffi/src/keyid.rs b/openpgp-ffi/src/keyid.rs index 8ec550a0..fb1fc735 100644 --- a/openpgp-ffi/src/keyid.rs +++ b/openpgp-ffi/src/keyid.rs @@ -87,5 +87,5 @@ fn pgp_keyid_from_hex(id: *const c_char) -> Maybe<KeyID> { /// Converts the KeyID to a hexadecimal number. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_keyid_to_hex(id: *const KeyID) -> *mut c_char { - ffi_return_string!(id.ref_raw().to_hex()) + ffi_return_string!(format!("{:X}", id.ref_raw())) } |