diff options
author | Valentin Popov <valentin@popov.link> | 2024-07-19 15:37:58 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2024-07-19 15:37:58 +0300 |
commit | a990de90fe41456a23e58bd087d2f107d321f3a1 (patch) | |
tree | 15afc392522a9e85dc3332235e311b7d39352ea9 /vendor/tiff/src/encoder/compression/uncompressed.rs | |
parent | 3d48cd3f81164bbfc1a755dc1d4a9a02f98c8ddd (diff) | |
download | fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.tar.xz fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.zip |
Deleted vendor folder
Diffstat (limited to 'vendor/tiff/src/encoder/compression/uncompressed.rs')
-rw-r--r-- | vendor/tiff/src/encoder/compression/uncompressed.rs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/vendor/tiff/src/encoder/compression/uncompressed.rs b/vendor/tiff/src/encoder/compression/uncompressed.rs deleted file mode 100644 index 900426f..0000000 --- a/vendor/tiff/src/encoder/compression/uncompressed.rs +++ /dev/null @@ -1,37 +0,0 @@ -use crate::{encoder::compression::*, tags::CompressionMethod}; -use std::io::Write; - -/// The default algorithm which does not compress at all. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] -pub struct Uncompressed; - -impl Compression for Uncompressed { - const COMPRESSION_METHOD: CompressionMethod = CompressionMethod::None; - - fn get_algorithm(&self) -> Compressor { - Compressor::Uncompressed(*self) - } -} - -impl CompressionAlgorithm for Uncompressed { - fn write_to<W: Write>(&mut self, writer: &mut W, bytes: &[u8]) -> Result<u64, io::Error> { - writer.write(bytes).map(|byte_count| byte_count as u64) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::encoder::compression::tests::TEST_DATA; - use std::io::Cursor; - - #[test] - fn test_no_compression() { - let mut compressed_data = Vec::<u8>::new(); - let mut writer = Cursor::new(&mut compressed_data); - Uncompressed::default() - .write_to(&mut writer, TEST_DATA) - .unwrap(); - assert_eq!(TEST_DATA, compressed_data); - } -} |