mirror of
https://github.com/cloudflare/workers-rs.git
synced 2025-12-08 18:01:59 +00:00
* Prototyping * rpc client example * Prototype WIT codegen * Documentation * Final tweaks
14 lines
452 B
Rust
14 lines
452 B
Rust
use std::env::var;
|
|
|
|
use worker_codegen::wit::expand_wit_source;
|
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
// Tell Cargo that if the given file changes, to rerun this build script.
|
|
println!("cargo::rerun-if-changed=wit/calculator.wit");
|
|
let source = expand_wit_source("wit/calculator.wit")?;
|
|
let out_dir = var("OUT_DIR")?;
|
|
let dest = format!("{}/calculator.rs", out_dir);
|
|
std::fs::write(dest, source)?;
|
|
Ok(())
|
|
}
|