]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #98801 - joshtriplett:file-create-new, r=thomcc
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Mon, 29 Aug 2022 11:19:38 +0000 (16:49 +0530)
committerGitHub <noreply@github.com>
Mon, 29 Aug 2022 11:19:38 +0000 (16:49 +0530)
commit1999ed798e5a77087cde68d2fb955d768ecfb5a4
tree1dd7fe9373264c0c258a8a3947391c23c4ca5b5e
parent4cac0bf66256947edce7039d8bf6a5832f85c64d
parente540425a2425819be4717ff0e4217c40cc52c99f
Rollup merge of #98801 - joshtriplett:file-create-new, r=thomcc

Add a `File::create_new` constructor

We have `File::create` for creating a file or opening an existing file,
but the secure way to guarantee creating a new file requires a longhand
invocation via `OpenOptions`.

Add `File::create_new` to handle this case, to make it easier for people
to do secure file creation.
library/std/src/fs.rs