/// Copies the given source directory into a newly-created directory.
///
/// Note: The copy is only of files and only one level deep (all that's
/// required for a CryptoComponent).
Copies the given source directory into a newly-created directory.
Note: The copy is only of files and only one level deep (all that's
required for a CryptoComponent).
Copies the given source directory into a newly - created directory . Note : The copy is only of files and only one level deep ( all that ' s required for a CryptoComponent ) .
fn copy_crypto_root(src: &Path, dest: &Path) {
        std::fs::create_dir_all(dest).unwrap_or_else(|err| {
            panic!(
                "Failed to create crypto root directory {}: {}",
                dest.display(),
                err
            )
        });
        for entry in std::fs::read_dir(src).expect("src directory doesn't exist") {
            let path = entry.expect("failed to get path in src dir").path();
            if path.is_file() {
                let filename = path.file_name().expect("failed to get src path");
                let dest_path = dest.join(filename);
                std::fs::copy(&path, &dest_path).expect("failed to copy file");
            }
        }
    }
fn copy_crypto_root ( src : & Path , dest : & Path ) { std :: fs :: create_dir_all ( dest ) . unwrap_or_else ( | err | { panic ! ( " " dest display ( ) err ) } ) ; for entry in std :: fs :: read_dir ( src ) . expect ( " " ) { let path = entry . expect ( " " ) . path ( ) ; if path . is_file ( ) { let filename = path . file_name ( ) . expect ( " " ) ; let dest_path = dest . join ( filename ) ; std :: fs :: copy ( & path , & dest_path ) . expect ( " " ) ; } } }
Copies the given source directory into a newly-created directory.
Copies the given source directory into a newly - created directory .
src
&Path
dest
&Path