(from: &std::path::Path, to: &std::path::Path)
| 2078 | /// process leaves behind, a database redb must repair before reading. |
| 2079 | fn copy_of_open_repository(source: &std::path::Path) -> tempfile::TempDir { |
| 2080 | fn copy_dir(from: &std::path::Path, to: &std::path::Path) { |
| 2081 | std::fs::create_dir_all(to).unwrap(); |
| 2082 | for entry in std::fs::read_dir(from).unwrap() { |
| 2083 | let entry = entry.unwrap(); |
| 2084 | let target = to.join(entry.file_name()); |
| 2085 | if entry.file_type().unwrap().is_dir() { |
| 2086 | copy_dir(&entry.path(), &target); |
| 2087 | } else { |
| 2088 | std::fs::copy(entry.path(), &target).unwrap(); |
| 2089 | } |
| 2090 | } |
| 2091 | } |
| 2092 | let copy = tempfile::tempdir().unwrap(); |
| 2093 | copy_dir(source, copy.path()); |
| 2094 | copy |
no test coverage detected