zulip-api 0.0.8

Client library for interacting with the Zulip API
Documentation
fn main() {
    use std::io::Read;

    println!("cargo::rerun-if-changed=Cargo.toml");

    let version = env!("CARGO_PKG_VERSION");

    if let Err(err) = std::fs::File::open("src/version.rs").and_then(|mut file| {
        let mut file_version = String::new();
        file.read_to_string(&mut file_version)?;

        if file_version.contains(version) {
            Ok(())
        } else {
            Err(std::io::Error::other(format!(
                "crate version mismatch, expected: {version}, update src/version.rs"
            )))
        }
    }) {
        panic!("Error reading src/version.rs from disk: {err}");
    }
}