lazippy 0.0.1

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

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

/// Decode a literal byte from the LZMA stream.
///
/// # Errors
/// Always returns [`LazippyError::NotYetImplemented`] until the literal decoder lands.
pub fn decode_literal(_input: &[u8], _pos: &mut usize) -> LazippyResult<u8> {
    Err(LazippyError::NotYetImplemented)
}

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

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