Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions crates/uv-fs/src/locked_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,7 @@ impl LockedFile {
}

// If path already exists, return it.
if let Ok(file) = fs_err::OpenOptions::new()
.read(true)
.write(true)
.open(path.as_ref())
{
if let Ok(file) = fs_err::OpenOptions::new().read(true).open(path.as_ref()) {
return Ok(file);
}

Expand All @@ -278,7 +274,6 @@ impl LockedFile {
if err.error.kind() == std::io::ErrorKind::AlreadyExists {
fs_err::OpenOptions::new()
.read(true)
.write(true)
.open(path.as_ref())
.map_err(Into::into)
} else if matches!(
Expand All @@ -300,7 +295,6 @@ impl LockedFile {
// bits, it's less likely to ever matter.
let file = fs_err::OpenOptions::new()
.read(true)
.write(true)
.create(true)
.open(path.as_ref())?;

Expand Down