diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-02-06 13:35:35 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-02-06 13:39:56 +0100 |
commit | 2a75428b44fd56616342a786cc33dd66145f6228 (patch) | |
tree | 3ccf25024106dec1d81954aa47b3e9bf152d124f /openpgp/src/packet/userid.rs | |
parent | d6f553a2f3063d2995fbd91ed137cc876d7ecdc0 (diff) |
openpgp: Rename consuming conversion functions.
- Rename functions that consume their receiver but are called
.to_...() to .into_...().
- For the packet types, simply drop the conversion function in favor
of using the From trait.
- Fixes #160.
Diffstat (limited to 'openpgp/src/packet/userid.rs')
-rw-r--r-- | openpgp/src/packet/userid.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/openpgp/src/packet/userid.rs b/openpgp/src/packet/userid.rs index d88b06b2..e3dcf625 100644 --- a/openpgp/src/packet/userid.rs +++ b/openpgp/src/packet/userid.rs @@ -83,16 +83,11 @@ impl UserID { pub fn set_userid(&mut self, userid: &str) { self.set_userid_from_bytes(userid.as_bytes()) } - - /// Convert the `UserID` struct to a `Packet`. - pub fn to_packet(self) -> Packet { - Packet::UserID(self) - } } impl From<UserID> for Packet { fn from(s: UserID) -> Self { - s.to_packet() + Packet::UserID(s) } } |