Skip to content

Commit

Permalink
Merge pull request #2 from fulcrumgenomics/bugfix/allow_for_multigz_e…
Browse files Browse the repository at this point in the history
…ncodings

Fixing issue with multigz encodings
  • Loading branch information
tfenne committed Dec 13, 2022
2 parents 2ee6124 + 3ea0365 commit 57dd407
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/io/mod.rs
Expand Up @@ -47,7 +47,7 @@ use std::path::Path;

use crate::{FgError, Result};
use csv::{QuoteStyle, ReaderBuilder, WriterBuilder};
use flate2::read::GzDecoder;
use flate2::read::MultiGzDecoder;
use flate2::write::GzEncoder;
use flate2::Compression;
use serde::{de::DeserializeOwned, Serialize};
Expand Down Expand Up @@ -94,7 +94,7 @@ impl Io {
{
let file = File::open(p).map_err(FgError::IoError)?;
let read: Box<dyn Read> =
if Io::is_gzip_path(p) { Box::new(GzDecoder::new(file)) } else { Box::new(file) };
if Io::is_gzip_path(p) { Box::new(MultiGzDecoder::new(file)) } else { Box::new(file) };

Ok(BufReader::new(read))
}
Expand Down

0 comments on commit 57dd407

Please sign in to comment.