binrw 0.11.2

A Rust crate for helping read structs from binary data using ✨macro magic✨
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fn main() {
    if is_nightly().unwrap_or(false) {
        println!("cargo:rustc-cfg=nightly");
    }
}

fn is_nightly() -> Option<bool> {
    let rustc = std::env::var_os("RUSTC")?;
    let output = std::process::Command::new(rustc)
        .arg("--version")
        .output()
        .ok()?;
    let version = core::str::from_utf8(&output.stdout).ok()?;
    let nightly = version.contains("nightly") || version.contains("dev");

    Some(nightly)
}