readmdict 0.1.0

A Rust implementation for reading MDict dictionary files (.mdx format)
Documentation
//! # rust-readmdict
//! 
//! A Rust library for reading MDict `.mdx` and `.mdd` files.

pub mod readmdict;

// Re-export all public items from readmdict
pub use readmdict::*;

#[cfg(test)]
mod tests {
    use super::*;
    use sha2::{Sha256, Digest};

    #[test]
    fn test_error_encoding() {
        // Test that Encoding variant is used
        let error = Error::Encoding("UTF-8 encoding error".to_string());
        match error {
            Error::Encoding(msg) => assert_eq!(msg, "UTF-8 encoding error"),
            _ => panic!("Expected Encoding error"),
        }
    }

    #[test]
    fn test_sha256_usage() {
        // Test that Sha256 is used to prevent unused import warning
        let mut hasher = Sha256::new();
        hasher.update(b"test data");
        let _result = hasher.finalize();
    }

    #[test]
    fn test_error_variants() {
        // Test all error variants to ensure they're used
        let _io_error = Error::Io(std::io::Error::new(std::io::ErrorKind::Other, "test"));
        let _encoding_error = Error::Encoding("test".to_string());
        let _invalid_format = Error::InvalidFormat("test".to_string());
        let _unsupported_compression = Error::UnsupportedCompression;
        let _encryption = Error::Encryption("test".to_string());
        let _invalid_passcode = Error::InvalidPasscode;
        let _checksum_mismatch = Error::ChecksumMismatch;
        let _parse = Error::Parse("test".to_string());
    }
}