Skip to content

Commit ad3829f

Browse files
committed
Auto merge of #61706 - petrhosek:bootstrap-cp-r, r=Mark-Simulacrum
Use Build::read_dir instead of fs::read_dir in Build::cp_r Build::read_dir does better error handling when the directory doesn't exist; it actually prints the name of the directory rather than just printing the underlying error "No such file or directory" which on its own isn't very useful.
2 parents 61a60ce + 449db68 commit ad3829f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/bootstrap/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1214,8 +1214,7 @@ impl Build {
12141214
/// when this function is called.
12151215
pub fn cp_r(&self, src: &Path, dst: &Path) {
12161216
if self.config.dry_run { return; }
1217-
for f in t!(fs::read_dir(src)) {
1218-
let f = t!(f);
1217+
for f in self.read_dir(src) {
12191218
let path = f.path();
12201219
let name = path.file_name().unwrap();
12211220
let dst = dst.join(name);

0 commit comments

Comments
 (0)