diff options
| author | bors <bors@rust-lang.org> | 2018-05-31 20:44:04 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-05-31 20:44:04 +0000 |
| commit | 1ffb321477d85fb3c95a0be2a0cd89c04dff0d8d (patch) | |
| tree | 2bf9c53f13bfbcc7549f2e2a2e2ab7ca92ca59e3 /src/libstd | |
| parent | 5342d40c1f49ef82ebff4c30fdad9f3b6fd339c1 (diff) | |
| parent | 7552c2ea6485a173a3c8241afc82e8fefe061885 (diff) | |
| download | rust-1ffb321477d85fb3c95a0be2a0cd89c04dff0d8d.tar.gz rust-1ffb321477d85fb3c95a0be2a0cd89c04dff0d8d.zip | |
Auto merge of #51257 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests Successful merges: - #49546 (Stabilize short error format) - #51123 (Update build instructions) - #51146 (typeck: Do not pass the field check on field error) - #51193 (Fixes some style issues in rustdoc "implementations on Foreign types") - #51213 (fs: copy: Use File::set_permissions instead of fs::set_permissions) - #51227 (mod.rs isn't beautiful) - #51240 (Two minor parsing tweaks) Failed merges:
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/sys/unix/fs.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index c4d94259bd6..c4092dcd388 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -817,7 +817,7 @@ pub fn canonicalize(p: &Path) -> io::Result<PathBuf> { #[cfg(not(any(target_os = "linux", target_os = "android")))] pub fn copy(from: &Path, to: &Path) -> io::Result<u64> { - use fs::{File, set_permissions}; + use fs::File; if !from.is_file() { return Err(Error::new(ErrorKind::InvalidInput, "the source path is not an existing regular file")) @@ -828,14 +828,14 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> { let perm = reader.metadata()?.permissions(); let ret = io::copy(&mut reader, &mut writer)?; - set_permissions(to, perm)?; + writer.set_permissions(perm)?; Ok(ret) } #[cfg(any(target_os = "linux", target_os = "android"))] pub fn copy(from: &Path, to: &Path) -> io::Result<u64> { use cmp; - use fs::{File, set_permissions}; + use fs::File; use sync::atomic::{AtomicBool, Ordering}; // Kernel prior to 4.5 don't have copy_file_range @@ -907,7 +907,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> { // Try again with fallback method assert_eq!(written, 0); let ret = io::copy(&mut reader, &mut writer)?; - set_permissions(to, perm)?; + writer.set_permissions(perm)?; return Ok(ret) }, _ => return Err(err), @@ -915,6 +915,6 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> { } } } - set_permissions(to, perm)?; + writer.set_permissions(perm)?; Ok(written) } |
