(from_dir: &Path, to_dir: &Path)
| 804 | } |
| 805 | |
| 806 | pub fn copy_corpus(from_dir: &Path, to_dir: &Path) -> Result<()> { |
| 807 | crate::deopt::utils::create_dir_if_nonexist(to_dir)?; |
| 808 | let lib_corpus_files = read_all_files_in_dir(from_dir)?; |
| 809 | for file in lib_corpus_files { |
| 810 | let lib_corpus = std::fs::read(&file)?; |
| 811 | let to_file: PathBuf = [ |
| 812 | to_dir.to_path_buf(), |
| 813 | file.file_name() |
| 814 | .unwrap() |
| 815 | .to_string_lossy() |
| 816 | .to_string() |
| 817 | .into(), |
| 818 | ] |
| 819 | .iter() |
| 820 | .collect(); |
| 821 | std::fs::write(to_file, lib_corpus)?; |
| 822 | } |
| 823 | Ok(()) |
| 824 | } |
| 825 | |
| 826 | pub fn get_file_hash_set(dir: &Path) -> HashSet<String> { |
| 827 | let mut sets = HashSet::new(); |
no test coverage detected