diff options
-rw-r--r-- | openpgp/src/constants.rs | 5 | ||||
-rw-r--r-- | openpgp/src/lib.rs | 6 | ||||
-rw-r--r-- | openpgp/src/parse/parse.rs | 8 | ||||
-rw-r--r-- | openpgp/src/serialize/stream.rs | 4 | ||||
-rw-r--r-- | tool/src/sqv.rs | 3 |
5 files changed, 15 insertions, 11 deletions
diff --git a/openpgp/src/constants.rs b/openpgp/src/constants.rs index 91b467c4..5b706369 100644 --- a/openpgp/src/constants.rs +++ b/openpgp/src/constants.rs @@ -1,3 +1,8 @@ +//! Constants used in OpenPGP. +//! +//! This module defines enumerations describing algorithms used in +//! OpenPGP. + use std::fmt; use std::str::FromStr; use std::result; diff --git a/openpgp/src/lib.rs b/openpgp/src/lib.rs index e55b4114..18d05c58 100644 --- a/openpgp/src/lib.rs +++ b/openpgp/src/lib.rs @@ -93,10 +93,8 @@ mod reader; pub use reader::Reader; mod message; -mod constants; -// XXX: Do we really want to put that into the toplevel? Why not make -// constants public? -pub use constants::{ +pub mod constants; +use constants::{ PublicKeyAlgorithm, SymmetricAlgorithm, CompressionAlgorithm, diff --git a/openpgp/src/parse/parse.rs b/openpgp/src/parse/parse.rs index 492a4ae6..f9aafb63 100644 --- a/openpgp/src/parse/parse.rs +++ b/openpgp/src/parse/parse.rs @@ -16,14 +16,10 @@ use { Result, MPIs, MPI, - SymmetricAlgorithm, CTB, BodyLength, S2K, Error, - HashAlgorithm, - CompressionAlgorithm, - PublicKeyAlgorithm, Tag, Header, Unknown, @@ -42,7 +38,11 @@ use { }; use constants::{ + CompressionAlgorithm, Curve, + HashAlgorithm, + PublicKeyAlgorithm, + SymmetricAlgorithm, }; use symmetric::{Decryptor, BufferedReaderDecryptor}; diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs index e437baae..cfe7f7f8 100644 --- a/openpgp/src/serialize/stream.rs +++ b/openpgp/src/serialize/stream.rs @@ -6,7 +6,6 @@ use nettle::{Hash, Yarrow}; use { Error, - SymmetricAlgorithm, HashAlgorithm, Literal, MDC, @@ -27,6 +26,7 @@ use super::{ }; use constants::{ CompressionAlgorithm, + SymmetricAlgorithm, }; /// Cookie must be public because the writers are. @@ -502,7 +502,7 @@ impl<'a> writer::Stackable<'a, Cookie> for LiteralWriter<'a> { /// /// ``` /// use openpgp::serialize::stream::{wrap, Compressor, LiteralWriter}; -/// use openpgp::CompressionAlgorithm; +/// use openpgp::constants::CompressionAlgorithm; /// # use openpgp::Result; /// # f().unwrap(); /// # fn f() -> Result<()> { diff --git a/tool/src/sqv.rs b/tool/src/sqv.rs index 159ca319..3c1acbd2 100644 --- a/tool/src/sqv.rs +++ b/tool/src/sqv.rs @@ -13,7 +13,8 @@ use std::process::exit; use clap::{App, Arg, AppSettings}; -use openpgp::{HashAlgorithm, TPK, Packet, Signature, KeyID, Message}; +use openpgp::{TPK, Packet, Signature, KeyID, Message}; +use openpgp::constants::HashAlgorithm; use openpgp::parse::PacketParser; // The argument parser. |