fn timestamp(f: impl AsRef<std::path::Path>) -> std::time::SystemTime {
std::fs::metadata(f).unwrap().modified().unwrap()
}
#[test]
fn protos() {
let out_time = timestamp("src/arc_vector.rs");
let mut protos = std::fs::read_dir("proto").unwrap();
if protos.any(|d| timestamp(d.unwrap().path()) > out_time) {
tonic_build::configure()
.out_dir("src/") .compile(
&["proto/arc_vector.proto"], &["proto"], )
.unwrap();
panic!("proto definitions changed. Stubs recompiled. Please commit the changes.")
}
}