mb_vin 0.8.0

A zero-copy parsing and validating vehicle identification numbers (VINs).
Documentation
//
// Copyright (c) 2025 murilo ijanc' <mbsd@m0x.ru>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
// Run: cargo run --example simple
//
use mb_vin::{Error, Vin};

fn main() -> Result<(), Error> {
    let vin_bytes = "5GZCZ43D13S812715";
    let vin = Vin::parse_str(vin_bytes)?;

    println!("WMI: {}", vin.wmi());
    println!("VDS: {}", vin.vds());
    println!("VIS: {}", vin.vis());
    println!("Check Digit: {}", vin.check_digit());

    if let Some(info) = vin.lookup_wmi_info() {
        println!("Country: {}", info.country);
    }

    if let Some(year) = vin.year_of_manufacture() {
        println!("Year: {}", year);
    }

    Ok(())
}