lazippy 0.0.1

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

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

/// Encodes a single bit into the range-coder stream.
///
/// # Errors
/// Always returns [`LazippyError::NotYetImplemented`] until the range coder lands.
pub fn encode_bit(_bit: u8, _output: &mut Vec<u8>) -> LazippyResult<()> {
    Err(LazippyError::NotYetImplemented)
}

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

    #[test]
    fn encode_bit_is_stub() {
        let mut out = Vec::new();
        let result = encode_bit(0, &mut out);
        assert!(
            matches!(result, Err(LazippyError::NotYetImplemented)),
            "expected NotYetImplemented, got {result:?}"
        );
    }
}