diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2020-04-06 17:26:23 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2020-04-06 18:35:13 +0200 |
commit | dfb77ce88553c3d81eeac3677b2e1d657833bb55 (patch) | |
tree | 74c23c39ad03be35744bb17b9bb1559da37aa36f /openpgp/src/keyhandle.rs | |
parent | 74e99d43769396d32820fa9c233ed7c541b13820 (diff) |
openpgp: Rename as_slice to as_bytes.
- KeyID::as_slice and KeyID::from_bytes mirror each other. This
should be reflected in the functions' names. Also, as_bytes is
more descriptive.
- Same for Fingerprint::as_slice and Fingerprint::as_bytes.
- KeyHandle::as_slice renamed for consistency.
Diffstat (limited to 'openpgp/src/keyhandle.rs')
-rw-r--r-- | openpgp/src/keyhandle.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/openpgp/src/keyhandle.rs b/openpgp/src/keyhandle.rs index 1e8ef0d4..c9b613c1 100644 --- a/openpgp/src/keyhandle.rs +++ b/openpgp/src/keyhandle.rs @@ -114,8 +114,8 @@ impl TryFrom<&KeyHandle> for Fingerprint { impl PartialOrd for KeyHandle { fn partial_cmp(&self, other: &KeyHandle) -> Option<Ordering> { - let a = self.as_slice(); - let b = other.as_slice(); + let a = self.as_bytes(); + let b = other.as_bytes(); let l = cmp::min(a.len(), b.len()); @@ -147,10 +147,10 @@ impl PartialEq for KeyHandle { impl KeyHandle { /// Returns a reference to the raw identifier. - pub fn as_slice(&self) -> &[u8] { + pub fn as_bytes(&self) -> &[u8] { match self { - KeyHandle::Fingerprint(i) => i.as_slice(), - KeyHandle::KeyID(i) => i.as_slice(), + KeyHandle::Fingerprint(i) => i.as_bytes(), + KeyHandle::KeyID(i) => i.as_bytes(), } } |