diff options
| author | Sikkema, Isaac <sikkemaic@ornl.gov> | 2022-08-25 18:00:45 -0400 |
|---|---|---|
| committer | Sikkema, Isaac <sikkemaic@ornl.gov> | 2022-08-25 18:00:45 -0400 |
| commit | 06139e57d5c0afb1e7e8d7815d742cd2da7d5dca (patch) | |
| tree | 17cbe640fecff07212d0ff606bbd551ae62a463b | |
| parent | 4d45b0745ab227feb9000bc15713ade4b99241ea (diff) | |
| download | rust-06139e57d5c0afb1e7e8d7815d742cd2da7d5dca.tar.gz rust-06139e57d5c0afb1e7e8d7815d742cd2da7d5dca.zip | |
use `File::options()` instead of `File::create()`
| -rw-r--r-- | compiler/rustc_serialize/src/opaque.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_serialize/src/opaque.rs b/compiler/rustc_serialize/src/opaque.rs index 5c17ef6ace2..f9edb073a2d 100644 --- a/compiler/rustc_serialize/src/opaque.rs +++ b/compiler/rustc_serialize/src/opaque.rs @@ -193,7 +193,7 @@ impl FileEncoder { // shaves an instruction off those code paths (on x86 at least). assert!(capacity <= usize::MAX - max_leb128_len()); - let file = File::create(path)?; + let file = File::options().read(true).write(true).create(true).truncate(true).open(path)?; Ok(FileEncoder { buf: Box::new_uninit_slice(capacity), |
