diff options
| author | Ahmed Charles <acharles@outlook.com> | 2016-08-27 01:47:03 -0700 |
|---|---|---|
| committer | Ahmed Charles <acharles@outlook.com> | 2016-09-11 16:00:50 -0700 |
| commit | f0a414e74e4bd4d70fcf93198791432705df9b92 (patch) | |
| tree | 2a6606fbc0a8c8c16ea89835e293b181f12db9b1 /src/tools | |
| parent | f1c6cad96398d558e6ecca9cc144a1b96da9e4c5 (diff) | |
| download | rust-f0a414e74e4bd4d70fcf93198791432705df9b92.tar.gz rust-f0a414e74e4bd4d70fcf93198791432705df9b92.zip | |
Use question_mark feature in compiletest.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 228d6ada01d..bfb85dd479d 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2113,23 +2113,23 @@ actual:\n\ } fn aggressive_rm_rf(&self, path: &Path) -> io::Result<()> { - for e in try!(path.read_dir()) { - let entry = try!(e); + for e in path.read_dir()? { + let entry = e?; let path = entry.path(); - if try!(entry.file_type()).is_dir() { - try!(self.aggressive_rm_rf(&path)); + if entry.file_type()?.is_dir() { + self.aggressive_rm_rf(&path)?; } else { // Remove readonly files as well on windows (by default we can't) - try!(fs::remove_file(&path).or_else(|e| { + fs::remove_file(&path).or_else(|e| { if cfg!(windows) && e.kind() == io::ErrorKind::PermissionDenied { - let mut meta = try!(entry.metadata()).permissions(); + let mut meta = entry.metadata()?.permissions(); meta.set_readonly(false); - try!(fs::set_permissions(&path, meta)); + fs::set_permissions(&path, meta)?; fs::remove_file(&path) } else { Err(e) } - })) + })?; } } fs::remove_dir(path) |
