pub fn ensure_persistent_pool_replica_version_compatibility(pool_path: PathBuf) {
    let mut replica_version_file_path = pool_path.clone();
    replica_version_file_path.push("replica_version");
    if get_replica_version(&replica_version_file_path) != Some(ReplicaVersion::default()) {
        if pool_path.exists() {
            for entry in fs::read_dir(&pool_path).expect("Couldn't read the directory") {
                let path = entry.expect("Couldn't read the metadata").path();
                if path.is_dir() {
                    fs::remove_dir_all(path).expect("Couldn't remove the directory");
                } else {
                    fs::remove_file(path).expect("Couldn't remove the file");
                }
            }
        }
        std::fs::create_dir_all(&pool_path).expect("Couldn't create a directory");
        set_replica_version(replica_version_file_path, &ReplicaVersion::default());
    }
}
/// Check that the replica version of the pool matches that of this process. If
/// it does not, delete the contents of the old pool directory and create a new
/// one.
Check that the replica version of the pool matches that of this process. If
it does not, delete the contents of the old pool directory and create a new
one.
Check that the replica version of the pool matches that of this process . If it does not delete the contents of the old pool directory and create a new one .
pub fn ensure_persistent_pool_replica_version_compatibility(pool_path: PathBuf) {
    let mut replica_version_file_path = pool_path.clone();
    replica_version_file_path.push("replica_version");
    if get_replica_version(&replica_version_file_path) != Some(ReplicaVersion::default()) {
        if pool_path.exists() {
            for entry in fs::read_dir(&pool_path).expect("Couldn't read the directory") {
                let path = entry.expect("Couldn't read the metadata").path();
                if path.is_dir() {
                    fs::remove_dir_all(path).expect("Couldn't remove the directory");
                } else {
                    fs::remove_file(path).expect("Couldn't remove the file");
                }
            }
        }
        std::fs::create_dir_all(&pool_path).expect("Couldn't create a directory");
        set_replica_version(replica_version_file_path, &ReplicaVersion::default());
    }
}
pub fn ensure_persistent_pool_replica_version_compatibility ( pool_path : PathBuf ) { let mut replica_version_file_path = pool_path . clone ( ) ; replica_version_file_path . push ( " " ) ; if get_replica_version ( & replica_version_file_path ) != Some ( ReplicaVersion :: default ( ) ) { if pool_path . exists ( ) { for entry in fs :: read_dir ( & pool_path ) . expect ( " " ) { let path = entry . expect ( " " ) . path ( ) ; if path . is_dir ( ) { fs :: remove_dir_all ( path ) . expect ( " " ) ; } else { fs :: remove_file ( path ) . expect ( " " ) ; } } } std :: fs :: create_dir_all ( & pool_path ) . expect ( " " ) ; set_replica_version ( replica_version_file_path , & ReplicaVersion :: default ( ) ) ; } }
Check that the replica version of the pool matches that of this process.
Check that the replica version of the pool matches that of this process .
pool_path
PathBuf
pool_path
PathBuf