fn _set_offset<R>(mut reader: R, offset: u64) -> AppResult<u64>
where
    R: Read,
{
    // if 0, nothing to do
    if offset == 0 {
        return Ok(0);
    }

    let pos = match reader.by_ref().bytes().nth((offset - 1) as usize) {
        None => {
            return Err(AppError::new_custom(
                AppCustomErrorKind::SeekPosBeyondEof,
                &format!("tried to set offset beyond EOF, at offset: {}", offset),
            ))
        }
        Some(x) => x,
    };
    Ok(pos.unwrap() as u64)
}
// This method is common to all compression ad-hoc seek method.
This method is common to all compression ad-hoc seek method.
This method is common to all compression ad - hoc seek method .
fn _set_offset<R>(mut reader: R, offset: u64) -> AppResult<u64>
where
    R: Read,
{
    // if 0, nothing to do
    if offset == 0 {
        return Ok(0);
    }
    let pos = match reader.by_ref().bytes().nth((offset - 1) as usize) {
        None => {
            return Err(AppError::new_custom(
                AppCustomErrorKind::SeekPosBeyondEof,
                &format!("tried to set offset beyond EOF, at offset: {}", offset),
            ))
        }
        Some(x) => x,
    };
    Ok(pos.unwrap() as u64)
}
fn _set_offset < R > ( mut reader : R , offset : u64 ) -> AppResult < u64 > where R : Read , { // if 0, nothing to do if offset == 0 { return Ok ( 0 ) ; } let pos = match reader . by_ref ( ) . bytes ( ) . nth ( ( offset - 1 ) as usize ) { None => { return Err ( AppError :: new_custom ( AppCustomErrorKind :: SeekPosBeyondEof , & format ! ( " " offset ) , ) ) } Some ( x ) => x , } ; Ok ( pos . unwrap ( ) as u64 ) }
This method is common to all compression ad-hoc seek method.
This method is common to all compression ad - hoc seek method .
reader
R
offset
u64
reader
R
offset
u64