1fn main() {
2 let test_crate_path = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
3 .join("test_crate")
4 .join("Cargo.toml");
5 println!("Begin watching for changes to {:?}", test_crate_path);
6 let watch = hotlib::watch(&test_crate_path).unwrap();
7 let mut lib = watch.package().build().unwrap().load().unwrap();
8 loop {
9 unsafe {
10 let foo: libloading::Symbol<fn(i32, i32) -> i32> = lib.get(b"foo").unwrap();
11 let res = foo(6, 7);
12 println!("{}", res);
13 }
14 println!("Awaiting next change...");
15 let pkg = watch.next().unwrap();
16 lib = pkg.build().unwrap().load().unwrap();
17 }
18}