diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-04-03 15:22:35 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-04-03 16:29:37 +0200 |
commit | 172e5df6a343402042c613b1024739e700756014 (patch) | |
tree | c7c82d88ca838e34f29dffaddc510800817600f3 /openpgp/src | |
parent | 9fa0c1972a9f36e3a55da95d4eed44601d4a3f9f (diff) |
openpgp: Rename.
Diffstat (limited to 'openpgp/src')
-rw-r--r-- | openpgp/src/serialize/stream.rs | 7 | ||||
-rw-r--r-- | openpgp/src/serialize/stream/padding.rs | 3 | ||||
-rw-r--r-- | openpgp/src/serialize/stream/writer/mod.rs | 2 | ||||
-rw-r--r-- | openpgp/src/serialize/stream/writer/writer_bzip2.rs | 3 | ||||
-rw-r--r-- | openpgp/src/serialize/stream/writer/writer_deflate.rs | 3 | ||||
-rw-r--r-- | openpgp/src/types/compression_level.rs (renamed from openpgp/src/serialize/stream/writer/compression_common.rs) | 0 | ||||
-rw-r--r-- | openpgp/src/types/mod.rs | 2 |
7 files changed, 12 insertions, 8 deletions
diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs index 8f377334..2196f9d7 100644 --- a/openpgp/src/serialize/stream.rs +++ b/openpgp/src/serialize/stream.rs @@ -38,6 +38,7 @@ use super::{ use crate::types::{ AEADAlgorithm, CompressionAlgorithm, + CompressionLevel, DataFormat, SignatureType, SymmetricAlgorithm, @@ -775,7 +776,7 @@ impl<'a> writer::Stackable<'a, Cookie> for LiteralWriter<'a> { /// # } pub struct Compressor<'a> { algo: CompressionAlgorithm, - level: writer::CompressionLevel, + level: CompressionLevel, inner: writer::BoxStack<'a, Cookie>, } @@ -799,7 +800,7 @@ impl<'a> Compressor<'a> { } /// Sets the compression level. - pub fn level(mut self, level: writer::CompressionLevel) -> Self { + pub fn level(mut self, level: CompressionLevel) -> Self { self.level = level; self } @@ -822,7 +823,7 @@ impl<'a> Compressor<'a> { pub(crate) // For CompressedData::serialize. fn new_naked(mut inner: Message<'a, Cookie>, algo: CompressionAlgorithm, - compression_level: writer::CompressionLevel, + compression_level: CompressionLevel, level: usize) -> Result<Message<'a, Cookie>> { diff --git a/openpgp/src/serialize/stream/padding.rs b/openpgp/src/serialize/stream/padding.rs index 3b08aa50..dbc15800 100644 --- a/openpgp/src/serialize/stream/padding.rs +++ b/openpgp/src/serialize/stream/padding.rs @@ -57,6 +57,7 @@ use crate::serialize::{ }; use crate::types::{ CompressionAlgorithm, + CompressionLevel, }; /// Pads a packet stream. @@ -150,7 +151,7 @@ impl<'a, P: Fn(u64) -> u64 + 'a> Padder<'a, P> { // Create an appropriate filter. let inner: Message<'a, Cookie> = writer::ZIP::new(inner, Cookie::new(level), - writer::CompressionLevel::none()); + CompressionLevel::none()); Ok(Message::from(Box::new(Self { inner: inner.into(), diff --git a/openpgp/src/serialize/stream/writer/mod.rs b/openpgp/src/serialize/stream/writer/mod.rs index 1006f0f5..44751c3f 100644 --- a/openpgp/src/serialize/stream/writer/mod.rs +++ b/openpgp/src/serialize/stream/writer/mod.rs @@ -8,8 +8,6 @@ pub use self::writer_bzip2::BZ; mod writer_deflate; #[cfg(feature = "compression-deflate")] pub use self::writer_deflate::{ZIP, ZLIB}; -mod compression_common; -pub use compression_common::CompressionLevel; use std::fmt; use std::io; diff --git a/openpgp/src/serialize/stream/writer/writer_bzip2.rs b/openpgp/src/serialize/stream/writer/writer_bzip2.rs index 1f5b6cdf..28401550 100644 --- a/openpgp/src/serialize/stream/writer/writer_bzip2.rs +++ b/openpgp/src/serialize/stream/writer/writer_bzip2.rs @@ -3,7 +3,8 @@ use std::fmt; use std::io; use crate::Result; -use super::{Generic, Message, BoxStack, Stackable, CompressionLevel}; +use crate::types::CompressionLevel; +use super::{Generic, Message, BoxStack, Stackable}; /// BZing writer. pub struct BZ<'a, C: 'a> { diff --git a/openpgp/src/serialize/stream/writer/writer_deflate.rs b/openpgp/src/serialize/stream/writer/writer_deflate.rs index b2cdd74f..b6e1116a 100644 --- a/openpgp/src/serialize/stream/writer/writer_deflate.rs +++ b/openpgp/src/serialize/stream/writer/writer_deflate.rs @@ -3,7 +3,8 @@ use std::fmt; use std::io; use crate::Result; -use super::{Generic, Message, BoxStack, Stackable, CompressionLevel}; +use crate::types::CompressionLevel; +use super::{Generic, Message, BoxStack, Stackable}; /// ZIPing writer. pub struct ZIP<'a, C: 'a> { diff --git a/openpgp/src/serialize/stream/writer/compression_common.rs b/openpgp/src/types/compression_level.rs index 7ac32d31..7ac32d31 100644 --- a/openpgp/src/serialize/stream/writer/compression_common.rs +++ b/openpgp/src/types/compression_level.rs diff --git a/openpgp/src/types/mod.rs b/openpgp/src/types/mod.rs index a2b38f65..2596159a 100644 --- a/openpgp/src/types/mod.rs +++ b/openpgp/src/types/mod.rs @@ -12,6 +12,8 @@ use quickcheck::{Arbitrary, Gen}; use crate::Error; use crate::Result; +mod compression_level; +pub use compression_level::CompressionLevel; mod features; pub use self::features::Features; mod key_flags; |