You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code creates a file only if the file does not exist
But look at the docs
For create()
For create_new()
I expected to see this happen: explanation
The functions to match their docs
Instead, this happened: explanation
They each do what the other is described to do
…ylan-DPC
Reword OpenOptions::{create, create_new} doc.
Closesrust-lang#69254.
Currently, the doc comment for `fs::OpenOptions::create` doesn't mention its behaviour when opening an existing file, and `fs::OpenOptions::create_new`'s doc comment is worded in a way that doesn't make it clear that it actually _fails_ if the file already exists, not overwrite the existing file with a new one.
This PR addresses addresses this by rewording the doc comments to be more explicit.
r? @GuillaumeGomez
I tried this code:
and it creates a file even if it already exists
This code creates a file only if the file does not exist
But look at the docs
For create()
For create_new()
I expected to see this happen: explanation
The functions to match their docs
Instead, this happened: explanation
They each do what the other is described to do
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: