diff options
| author | kennytm <kennytm@gmail.com> | 2018-12-03 18:07:15 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-03 18:07:15 +0800 |
| commit | ca98bce303a2ed8f9b21eb6d2e602e76a7c00754 (patch) | |
| tree | 9a38c8fa276be6a7618fbc012a0f09bd2ba0ad4f /src/bootstrap | |
| parent | 71d76bec1e162c90def081494add1150f47e598c (diff) | |
| parent | e7e96921c28ab8d29b6ee61053152eead822f09a (diff) | |
| download | rust-ca98bce303a2ed8f9b21eb6d2e602e76a7c00754.tar.gz rust-ca98bce303a2ed8f9b21eb6d2e602e76a7c00754.zip | |
Rollup merge of #56419 - mark-i-m:remove-try, r=Centril
Remove some uses of try!
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/doc.rs | 6 | ||||
| -rw-r--r-- | src/bootstrap/util.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index 18a2b950e59..201129b92df 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -915,13 +915,13 @@ fn symlink_dir_force(config: &Config, src: &Path, dst: &Path) -> io::Result<()> } if let Ok(m) = fs::symlink_metadata(dst) { if m.file_type().is_dir() { - try!(fs::remove_dir_all(dst)); + fs::remove_dir_all(dst)?; } else { // handle directory junctions on windows by falling back to // `remove_dir`. - try!(fs::remove_file(dst).or_else(|_| { + fs::remove_file(dst).or_else(|_| { fs::remove_dir(dst) - })); + })?; } } diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs index 8ce8f20add3..be24ae0ce66 100644 --- a/src/bootstrap/util.rs +++ b/src/bootstrap/util.rs @@ -203,11 +203,11 @@ pub fn symlink_dir(config: &Config, src: &Path, dest: &Path) -> io::Result<()> { // We're using low-level APIs to create the junction, and these are more // picky about paths. For example, forward slashes cannot be used as a // path separator, so we should try to canonicalize the path first. - let target = try!(fs::canonicalize(target)); + let target = fs::canonicalize(target)?; - try!(fs::create_dir(junction)); + fs::create_dir(junction)?; - let path = try!(to_u16s(junction)); + let path = to_u16s(junction)?; unsafe { let h = CreateFileW(path.as_ptr(), |
