open-coroutine 0.4.4

The open-coroutine is a simple, efficient and generic stackful-coroutine library.
Documentation
use std::env;
use std::path::PathBuf;
use std::time::Duration;

fn main() {
    //copy dylib to deps
    let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
    let deps = out_dir
        .parent()
        .unwrap()
        .parent()
        .unwrap()
        .parent()
        .unwrap()
        .join("deps");
    let pattern = deps.to_str().unwrap().to_owned() + "/libopen_coroutine_hooks*.*";
    let mut find = false;
    while !find {
        for path in glob::glob(&pattern)
            .expect("Failed to read glob pattern")
            .flatten()
        {
            if cfg!(target_os = "linux") {
                std::fs::rename(path, deps.join("libopen_coroutine_hooks.so"))
                    .expect("rename to libopen_coroutine_hooks.so failed!");
                find = true;
            } else if cfg!(target_os = "macos") {
                std::fs::rename(path, deps.join("libopen_coroutine_hooks.dylib"))
                    .expect("rename to libopen_coroutine_hooks.dylib failed!");
                find = true;
            }
        }
        std::thread::sleep(Duration::from_millis(10));
    }
    //link hook dylib
    println!("cargo:rustc-link-lib=dylib=open_coroutine_hooks");
}