diff options
Diffstat (limited to 'src/connection.rs')
-rw-r--r-- | src/connection.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/connection.rs b/src/connection.rs index 4da97bb..c061c85 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -1,3 +1,4 @@ +#[cfg(feature = "encryption")] use crate::cfb8::CipherError; use crate::reader::{CraftReader, CraftSyncReader, ReadResult}; use crate::wrapper::{CraftIo, CraftWrapper}; @@ -27,11 +28,13 @@ impl<R, W> CraftIo for CraftConnection<R, W> { self.writer.set_state(next); } + #[cfg(feature = "compression")] fn set_compression_threshold(&mut self, threshold: Option<i32>) { self.reader.set_compression_threshold(threshold); self.writer.set_compression_threshold(threshold); } + #[cfg(feature = "encryption")] fn enable_encryption(&mut self, key: &[u8], iv: &[u8]) -> Result<(), CipherError> { self.reader.enable_encryption(key, iv)?; self.writer.enable_encryption(key, iv)?; |