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/src/fingerprint.rs | |
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/src/fingerprint.rs')
-rw-r--r-- | openpgp/src/fingerprint.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/openpgp/src/fingerprint.rs b/openpgp/src/fingerprint.rs index fedf23b5..edbc0774 100644 --- a/openpgp/src/fingerprint.rs +++ b/openpgp/src/fingerprint.rs @@ -63,7 +63,7 @@ impl Fingerprint { /// let hex = "3E8877C877274692975189F5D03F6F865226FE8B"; /// let fp = Fingerprint::from_hex(hex); /// assert!(fp.is_ok()); - /// assert_eq!(fp.unwrap().to_hex(), hex); + /// assert_eq!(format!("{:X}", fp.unwrap()), hex); /// ``` pub fn from_hex(hex: &str) -> Result<Fingerprint> { Ok(Fingerprint::from_bytes(&crate::fmt::from_hex(hex, true)?[..])) @@ -77,11 +77,6 @@ impl Fingerprint { } } - /// Converts the fingerprint to a hexadecimal number. - pub fn to_hex(&self) -> String { - self.convert_to_string(false) - } - /// Common code for the above functions. fn convert_to_string(&self, pretty: bool) -> String { let raw = match self { @@ -140,7 +135,7 @@ impl Fingerprint { pub fn to_icao(&self) -> String { let mut ret = String::default(); - for ch in self.to_hex().chars() { + for ch in self.convert_to_string(false).chars() { let word = match ch { '0' => "Zero", '1' => "One", |