// Returns the File and whether this is the gzip version.
Returns the File and whether this is the gzip version.
Returns the File and whether this is the gzip version .
async fn open_file(path: &str, gzip: bool) -> Result<(File, bool), ::std::io::Error> {
    // First test if we have a gzipped version.
    if gzip {
        let file = File::open(path.to_owned() + ".gz").await;
        if file.is_ok() {
            return Ok((file.unwrap(), true));
        }
    }
    File::open(path).await.map(|file| (file, false))
}
async fn open_file ( path : & str , gzip : bool ) -> Result < ( File , bool ) , :: std :: io :: Error > { // First test if we have a gzipped version. if gzip { let file = File :: open ( path . to_owned ( ) + " " ) . await ; if file . is_ok ( ) { return Ok ( ( file . unwrap ( ) , true ) ) ; } } File :: open ( path ) . await . map ( | file | ( file , false ) ) }
Returns the File and whether this is the gzip version.
Returns the File and whether this is the gzip version .
path
&str
gzip
bool