diff options
-rw-r--r-- | openpgp/src/armor.rs | 2 | ||||
-rw-r--r-- | openpgp/src/lib.rs | 10 | ||||
-rw-r--r-- | openpgp/src/message/mod.rs | 4 | ||||
-rw-r--r-- | openpgp/src/packet/ctb.rs | 2 | ||||
-rw-r--r-- | openpgp/src/packet/key.rs | 2 | ||||
-rw-r--r-- | openpgp/src/packet/mod.rs | 3 | ||||
-rw-r--r-- | openpgp/src/packet/tag.rs (renamed from openpgp/src/tag.rs) | 2 | ||||
-rw-r--r-- | openpgp/src/packet/unknown.rs | 2 | ||||
-rw-r--r-- | openpgp/src/parse/parse.rs | 2 | ||||
-rw-r--r-- | openpgp/src/serialize/mod.rs | 1 | ||||
-rw-r--r-- | openpgp/src/serialize/stream.rs | 2 | ||||
-rw-r--r-- | openpgp/src/tpk/mod.rs | 2 | ||||
-rw-r--r-- | openpgp/src/tsk.rs | 2 |
13 files changed, 19 insertions, 17 deletions
diff --git a/openpgp/src/armor.rs b/openpgp/src/armor.rs index a09b93be..b0d0cae4 100644 --- a/openpgp/src/armor.rs +++ b/openpgp/src/armor.rs @@ -679,7 +679,7 @@ impl<'a> Reader<'a> { /// Checks whether the given bytes contain armored OpenPGP data. fn is_armored_pgp_blob(bytes: &[u8]) -> bool { - use Tag::*; + use packet::Tag::*; let bytes = if let Some(msg) = get_base64_prefix(bytes) { msg diff --git a/openpgp/src/lib.rs b/openpgp/src/lib.rs index 15ffa7a2..caa793c7 100644 --- a/openpgp/src/lib.rs +++ b/openpgp/src/lib.rs @@ -133,8 +133,6 @@ use constants::{ HashAlgorithm, SignatureType, }; -mod tag; -use tag::Tag; mod fingerprint; mod keyid; @@ -171,7 +169,7 @@ pub enum Error { /// Unknown packet tag. #[fail(display = "Unknown packet type: {}", _0)] - UnknownPacketTag(Tag), + UnknownPacketTag(packet::Tag), /// Unknown hash algorithm identifier. #[fail(display = "Unknown hash algorithm: {}", _0)] @@ -308,7 +306,8 @@ impl Packet { /// Tags are explained in [Section 4.3 of RFC 4880]. /// /// [Section 4.3 of RFC 4880]: https://tools.ietf.org/html/rfc4880#section-4.3 - pub fn tag(&self) -> Tag { + pub fn tag(&self) -> packet::Tag { + use packet::Tag; match self { &Packet::Unknown(ref packet) => packet.tag, &Packet::Signature(_) => Tag::Signature, @@ -336,7 +335,8 @@ impl Packet { /// Signature Packet uses some unsupported methods, it is parsed /// into an `Packet::Unknown`. `tag()` returns `Tag::Signature`, /// whereas `kind()` returns `None`. - pub fn kind(&self) -> Option<Tag> { + pub fn kind(&self) -> Option<packet::Tag> { + use packet::Tag; match self { &Packet::Unknown(_) => None, &Packet::Signature(_) => Some(Tag::Signature), diff --git a/openpgp/src/message/mod.rs b/openpgp/src/message/mod.rs index dfa332a9..6f9c2ebc 100644 --- a/openpgp/src/message/mod.rs +++ b/openpgp/src/message/mod.rs @@ -402,7 +402,7 @@ mod tests { use SignatureType; use s2k::S2K; use mpis::{Ciphertext, MPI}; - use Tag; + use packet::Tag; use packet::CompressedData; use packet::Literal; use packet::OnePassSig; @@ -559,7 +559,7 @@ mod tests { #[test] fn tags() { - use Tag::*; + use packet::Tag::*; struct TestVector<'a> { s: &'a [(Tag, isize)], diff --git a/openpgp/src/packet/ctb.rs b/openpgp/src/packet/ctb.rs index 359694ca..f20fb6ab 100644 --- a/openpgp/src/packet/ctb.rs +++ b/openpgp/src/packet/ctb.rs @@ -7,7 +7,7 @@ use std::ops::Deref; use { - Tag, + packet::Tag, Error, Result }; diff --git a/openpgp/src/packet/key.rs b/openpgp/src/packet/key.rs index 216d6b21..bab25bbb 100644 --- a/openpgp/src/packet/key.rs +++ b/openpgp/src/packet/key.rs @@ -3,7 +3,7 @@ use time; use Error; use mpis; -use Tag; +use packet::Tag; use packet; use Packet; use PublicKeyAlgorithm; diff --git a/openpgp/src/packet/mod.rs b/openpgp/src/packet/mod.rs index 81db60c8..2347b43c 100644 --- a/openpgp/src/packet/mod.rs +++ b/openpgp/src/packet/mod.rs @@ -18,7 +18,8 @@ use self::ctb::{CTB, PacketLengthType}; use buffered_reader::BufferedReader; -pub use tag::Tag; +mod tag; +pub use self::tag::Tag; mod unknown; pub use self::unknown::Unknown; diff --git a/openpgp/src/tag.rs b/openpgp/src/packet/tag.rs index 31365ae7..5dd27fc7 100644 --- a/openpgp/src/tag.rs +++ b/openpgp/src/packet/tag.rs @@ -55,7 +55,7 @@ pub enum Tag { impl From<u8> for Tag { fn from(u: u8) -> Self { - use Tag::*; + use packet::Tag::*; match u { 0 => Reserved, diff --git a/openpgp/src/packet/unknown.rs b/openpgp/src/packet/unknown.rs index 3d284fda..7eb3966f 100644 --- a/openpgp/src/packet/unknown.rs +++ b/openpgp/src/packet/unknown.rs @@ -1,4 +1,4 @@ -use Tag; +use packet::Tag; use packet; use Packet; diff --git a/openpgp/src/parse/parse.rs b/openpgp/src/parse/parse.rs index c8ff2973..8416ed9c 100644 --- a/openpgp/src/parse/parse.rs +++ b/openpgp/src/parse/parse.rs @@ -22,7 +22,7 @@ use { BodyLength, s2k::S2K, Error, - Tag, + packet::Tag, Header, packet::Unknown, packet::{signature, Signature}, diff --git a/openpgp/src/serialize/mod.rs b/openpgp/src/serialize/mod.rs index bf7c7080..93dff1d3 100644 --- a/openpgp/src/serialize/mod.rs +++ b/openpgp/src/serialize/mod.rs @@ -27,6 +27,7 @@ use conversions::{ Duration, }; use packet::{ + Tag, Unknown, Signature, OnePassSig, diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs index af408c63..94e046d5 100644 --- a/openpgp/src/serialize/stream.rs +++ b/openpgp/src/serialize/stream.rs @@ -32,7 +32,7 @@ use { packet::SKESK4, packet::SKESK5, packet::{signature, Signature}, - Tag, + packet::Tag, TPK, }; use packet::ctb::CTB; diff --git a/openpgp/src/tpk/mod.rs b/openpgp/src/tpk/mod.rs index a5a9fa3e..3e210b80 100644 --- a/openpgp/src/tpk/mod.rs +++ b/openpgp/src/tpk/mod.rs @@ -16,7 +16,7 @@ use { RevocationStatus, SignatureType, HashAlgorithm, - Tag, + packet::Tag, SecretKey, packet::{signature, Signature}, packet::Key, diff --git a/openpgp/src/tsk.rs b/openpgp/src/tsk.rs index 8fce94c4..75ca9ac0 100644 --- a/openpgp/src/tsk.rs +++ b/openpgp/src/tsk.rs @@ -1,7 +1,7 @@ use { Result, TPK, - Tag, + packet::Tag, }; use serialize::{ Serialize, |