lazippy 0.0.1

Pure-Rust LZMA (Lempel-Ziv-Markov chain Algorithm), part of the 8z umbrella
Documentation
//! Range-coder decoder stub.

use crate::error::{LazippyError, LazippyResult};

/// Decodes a single bit from the range-coder stream.
///
/// # Errors
/// Always returns [`LazippyError::NotYetImplemented`] until the range coder lands.
pub fn decode_bit(_input: &[u8], _pos: &mut usize) -> LazippyResult<u8> {
    Err(LazippyError::NotYetImplemented)
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn decode_bit_is_stub() {
        let mut pos = 0usize;
        let result = decode_bit(&[], &mut pos);
        assert!(
            matches!(result, Err(LazippyError::NotYetImplemented)),
            "expected NotYetImplemented, got {result:?}"
        );
    }
}