add comment explaining read permissions
This commit is contained in:
parent
06139e57d5
commit
a2cb8a4949
1 changed files with 2 additions and 0 deletions
|
@ -193,6 +193,8 @@ impl FileEncoder {
|
|||
// shaves an instruction off those code paths (on x86 at least).
|
||||
assert!(capacity <= usize::MAX - max_leb128_len());
|
||||
|
||||
// Create the file for reading and writing, because some encoders do both
|
||||
// (e.g. the metadata encoder when -Zmeta-stats is enabled)
|
||||
let file = File::options().read(true).write(true).create(true).truncate(true).open(path)?;
|
||||
|
||||
Ok(FileEncoder {
|
||||
|
|
Loading…
Add table
Reference in a new issue