1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-05 13:59:01 -05:00

chore: lint ext/fs/std_fs.rs (#19036)

This commit is contained in:
Bartek Iwańczuk 2023-05-07 22:43:16 +02:00 committed by David Sherret
parent 6e72ae7a09
commit bf7d3b76e2

View file

@ -434,7 +434,7 @@ fn copy_file(from: &Path, to: &Path) -> FsResult<()> {
// Do a regular copy. fcopyfile() is an overkill for < 128KB
// files.
let mut buf = [0u8; 128 * 1024];
let mut from_file = fs::File::open(&from)?;
let mut from_file = fs::File::open(from)?;
let perm = from_file.metadata()?.permissions();
let mut to_file = fs::OpenOptions::new()
@ -443,7 +443,7 @@ fn copy_file(from: &Path, to: &Path) -> FsResult<()> {
.write(true)
.create(true)
.truncate(true)
.open(&to)?;
.open(to)?;
let writer_metadata = to_file.metadata()?;
if writer_metadata.is_file() {
// Set the correct file permissions, in case the file already existed.