Skip to content

Commit f0a414e

Browse files
committed
Use question_mark feature in compiletest.
1 parent f1c6cad commit f0a414e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,23 +2113,23 @@ actual:\n\
21132113
}
21142114

21152115
fn aggressive_rm_rf(&self, path: &Path) -> io::Result<()> {
2116-
for e in try!(path.read_dir()) {
2117-
let entry = try!(e);
2116+
for e in path.read_dir()? {
2117+
let entry = e?;
21182118
let path = entry.path();
2119-
if try!(entry.file_type()).is_dir() {
2120-
try!(self.aggressive_rm_rf(&path));
2119+
if entry.file_type()?.is_dir() {
2120+
self.aggressive_rm_rf(&path)?;
21212121
} else {
21222122
// Remove readonly files as well on windows (by default we can't)
2123-
try!(fs::remove_file(&path).or_else(|e| {
2123+
fs::remove_file(&path).or_else(|e| {
21242124
if cfg!(windows) && e.kind() == io::ErrorKind::PermissionDenied {
2125-
let mut meta = try!(entry.metadata()).permissions();
2125+
let mut meta = entry.metadata()?.permissions();
21262126
meta.set_readonly(false);
2127-
try!(fs::set_permissions(&path, meta));
2127+
fs::set_permissions(&path, meta)?;
21282128
fs::remove_file(&path)
21292129
} else {
21302130
Err(e)
21312131
}
2132-
}))
2132+
})?;
21332133
}
21342134
}
21352135
fs::remove_dir(path)

0 commit comments

Comments
 (0)