sparkles-core 0.1.4

Core crate for sparkles
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::{env, fs};
use std::path::PathBuf;

fn main() -> std::io::Result<()> {
    let out_dir_path = PathBuf::from(env::var_os("OUT_DIR").unwrap());
    let out_file_path = out_dir_path.join("consts.rs");

    let encoder_version: u32 = fs::read_to_string("ENCODER_VERSION")?.parse().unwrap();
    
    fs::write(&out_file_path, format!("pub const ENCODER_VERSION: u32 = {};\n", encoder_version))?;
    
    Ok(())
}