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/literal.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/literal.rs')
-rw-r--r-- | openpgp/src/packet/literal.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/openpgp/src/packet/literal.rs b/openpgp/src/packet/literal.rs index 05a8047d..48b31775 100644 --- a/openpgp/src/packet/literal.rs +++ b/openpgp/src/packet/literal.rs @@ -163,16 +163,11 @@ impl Literal { self.date = timestamp.map(|t| t.canonicalize()) .unwrap_or(time::Tm::from_pgp(0)); } - - /// Convert the `Literal` struct to a `Packet`. - pub fn to_packet(self) -> Packet { - Packet::Literal(self) - } } impl From<Literal> for Packet { fn from(s: Literal) -> Self { - s.to_packet() + Packet::Literal(s) } } |