lazippy 0.0.1

Pure-Rust LZMA (Lempel-Ziv-Markov chain Algorithm), part of the 8z umbrella
Documentation
//! LZMA match finder stub.
//!
//! The match finder scans the input for the longest match in the dictionary
//! and returns a (length, distance) pair for the encoder to emit.

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

/// Find the longest match for the byte at `pos` in `input`.
///
/// # Errors
/// Always returns [`LazippyError::NotYetImplemented`] until the match finder lands.
pub fn find_match(_input: &[u8], _pos: usize) -> LazippyResult<Option<(u32, u32)>> {
    Err(LazippyError::NotYetImplemented)
}

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

    #[test]
    fn find_match_is_stub() {
        let result = find_match(b"hello hello", 6);
        assert!(
            matches!(result, Err(LazippyError::NotYetImplemented)),
            "expected NotYetImplemented, got {result:?}"
        );
    }
}