diff options
| author | Fenrir <[email protected]> | 2016-10-02 21:30:16 -0700 |
|---|---|---|
| committer | Fenrir <[email protected]> | 2016-10-02 21:30:16 -0700 |
| commit | ee0873ab366ccdf8a5bd7e712569cbddf34a7150 (patch) | |
| tree | b41967c1d68288401b39b9736bb1e6787a56e27e | |
| parent | update unicode methods in wtf8 module (diff) | |
| download | ctru-rs-ee0873ab366ccdf8a5bd7e712569cbddf34a7150.tar.xz ctru-rs-ee0873ab366ccdf8a5bd7e712569cbddf34a7150.zip | |
Make OpenOptions logic slightly less ugly
| -rw-r--r-- | src/services/fs.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/services/fs.rs b/src/services/fs.rs index 6bca22a..c52addf 100644 --- a/src/services/fs.rs +++ b/src/services/fs.rs @@ -453,9 +453,7 @@ impl OpenOptions { /// /// If both truncate and append are set to true, the file will simply be truncated pub fn append(&mut self, append: bool) -> &mut OpenOptions { - // we're going to be cheeky and just manually set write access here self.append = append; - self.write = append; self } @@ -536,7 +534,7 @@ impl OpenOptions { } fn get_open_flags(&self) -> u32 { - match (self.read, self.write, self.create) { + match (self.read, self.write || self.append, self.create) { (true, false, false) => FS_OPEN_READ, (false, true, false) => FS_OPEN_WRITE, (false, true, true) => FS_OPEN_WRITE | FS_OPEN_CREATE, |