summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2018-06-11 14:39:22 +0200
committerJustus Winter <justus@sequoia-pgp.org>2018-06-11 14:39:22 +0200
commit25b9ad3c448ff28dfad8bf8bedcaefdcc6c5495f (patch)
tree13dd2080ebc7123ee1af445607a05666f54baf77
parent3c29d2fdc7fa884b57267eda4077ddf60564e267 (diff)
openpgp: Do not re-export *Algorithm in the root.
-rw-r--r--openpgp/src/constants.rs5
-rw-r--r--openpgp/src/lib.rs6
-rw-r--r--openpgp/src/parse/parse.rs8
-rw-r--r--openpgp/src/serialize/stream.rs4
-rw-r--r--tool/src/sqv.rs3
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.