Skip to content

Commit 5dfd1c1

Browse files
committed
Optimize away another path lookup.
1 parent e33dbc0 commit 5dfd1c1

File tree

1 file changed

+1
-1
lines changed
  • library/std/src/sys_common

1 file changed

+1
-1
lines changed

library/std/src/sys_common/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
1919
let perm = reader.metadata()?.permissions();
2020

2121
let ret = io::copy(&mut reader, &mut writer)?;
22-
fs::set_permissions(to, perm)?;
22+
writer.set_permissions(perm)?;
2323
Ok(ret)
2424
}
2525

0 commit comments

Comments
 (0)