aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFenrir <[email protected]>2016-10-02 21:30:16 -0700
committerFenrir <[email protected]>2016-10-02 21:30:16 -0700
commitee0873ab366ccdf8a5bd7e712569cbddf34a7150 (patch)
treeb41967c1d68288401b39b9736bb1e6787a56e27e
parentupdate unicode methods in wtf8 module (diff)
downloadctru-rs-ee0873ab366ccdf8a5bd7e712569cbddf34a7150.tar.xz
ctru-rs-ee0873ab366ccdf8a5bd7e712569cbddf34a7150.zip
Make OpenOptions logic slightly less ugly
-rw-r--r--src/services/fs.rs4
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,