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/unknown.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/unknown.rs')
-rw-r--r-- | openpgp/src/packet/unknown.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/openpgp/src/packet/unknown.rs b/openpgp/src/packet/unknown.rs index 0819c375..ca7d40e6 100644 --- a/openpgp/src/packet/unknown.rs +++ b/openpgp/src/packet/unknown.rs @@ -52,15 +52,10 @@ impl Unknown { pub fn set_body(&mut self, data: Vec<u8>) { self.common.body = Some(data); } - - /// Convert the `Unknown` struct to a `Packet`. - pub fn to_packet(self) -> Packet { - Packet::Unknown(self) - } } impl From<Unknown> for Packet { fn from(s: Unknown) -> Self { - s.to_packet() + Packet::Unknown(s) } } |