fn main() -> Result<(), Box<dyn std::error::Error>> {
// This tells Cargo to re-run this build script only if the .proto file changes.
println!("cargo:rerun-if-changed=proto/parliament.proto");
prost_build::Config::new()
// This is a key performance optimization. It tells prost to use the `bytes::Bytes`
// type for `bytes` fields in the .proto file. This makes clones an O(1) operation.
.bytes(&["."])
// Compile the .proto file. The generated code will be placed in `OUT_DIR`.
.compile_protos(&["proto/parliament.proto"], &["proto/"])?;
Ok(())
}