fix: put eprintln usage behind #[cfg(debug_assertions)]

This commit is contained in:
Lucas Nogueira 2022-01-28 20:00:24 -03:00
parent 696dca58a9
commit dc8ae7485e
No known key found for this signature in database
GPG Key ID: 2714B66BCFB01F7F

View File

@ -40,6 +40,7 @@ impl<R: Read + Seek> Extract<R> {
/// Create archive from reader.
pub fn from_cursor(mut reader: R, archive_format: ArchiveFormat) -> Extract<R> {
if reader.seek(io::SeekFrom::Start(0)).is_err() {
#[cfg(debug_assertions)]
eprintln!("Could not seek to start of the file");
}
Extract {
@ -53,6 +54,7 @@ impl<R: Read + Seek> Extract<R> {
let reader = &mut self.reader;
let mut all_files = Vec::new();
if reader.seek(io::SeekFrom::Start(0)).is_err() {
#[cfg(debug_assertions)]
eprintln!("Could not seek to start of the file");
}
match self.archive_format {
@ -88,6 +90,7 @@ impl<R: Read + Seek> Extract<R> {
compression: Option<Compression>,
) -> Either<&mut R, flate2::read::GzDecoder<&mut R>> {
if source.seek(io::SeekFrom::Start(0)).is_err() {
#[cfg(debug_assertions)]
eprintln!("Could not seek to start of the file");
}
match compression {
@ -102,6 +105,7 @@ impl<R: Read + Seek> Extract<R> {
pub fn extract_into(&mut self, into_dir: &path::Path) -> crate::api::Result<()> {
let reader = &mut self.reader;
if reader.seek(io::SeekFrom::Start(0)).is_err() {
#[cfg(debug_assertions)]
eprintln!("Could not seek to start of the file");
}
match self.archive_format {