Skip to content

Commit

Permalink
Import BoundedDecompressionError
Browse files Browse the repository at this point in the history
  • Loading branch information
fintelia committed Jan 29, 2024
1 parent 211833f commit 2bd3dc9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/text_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
#![warn(missing_docs)]

use crate::{chunk, encoder, DecodingError, EncodingError};
use fdeflate::BoundedDecompressionError;
use flate2::write::ZlibEncoder;
use flate2::Compression;
use std::{convert::TryFrom, io::Write};
Expand Down Expand Up @@ -288,7 +289,7 @@ impl ZTXtChunk {
OptCompressed::Compressed(v) => {
let uncompressed_raw = match fdeflate::decompress_to_vec_bounded(&v[..], limit) {
Ok(s) => s,
Err(fdeflate::BoundedDecompressionError::OutputTooLarge { .. }) => {
Err(BoundedDecompressionError::OutputTooLarge { .. }) => {
return Err(DecodingError::from(
TextDecodingError::OutOfDecompressionSpace,
));
Expand Down Expand Up @@ -458,7 +459,7 @@ impl ITXtChunk {
OptCompressed::Compressed(v) => {
let uncompressed_raw = match fdeflate::decompress_to_vec_bounded(v, limit) {
Ok(s) => s,
Err(fdeflate::BoundedDecompressionError::OutputTooLarge { .. }) => {
Err(BoundedDecompressionError::OutputTooLarge { .. }) => {
return Err(DecodingError::from(
TextDecodingError::OutOfDecompressionSpace,
));
Expand Down

0 comments on commit 2bd3dc9

Please sign in to comment.