From 7d70add8f317caea68e9ff3a64f17a3c150f3ef1 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Fri, 14 Apr 2023 15:08:37 -0400 Subject: [PATCH] Fix mutability issues after merge of master --- ctru-rs/src/services/fs.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index 962e048..e3f45b0 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -103,7 +103,7 @@ pub struct Fs(()); /// ```no_run /// use ctru::services::fs::Fs; /// -/// let fs = Fs::init().unwrap(); +/// let mut fs = Fs::init().unwrap(); /// let sdmc_archive = fs.sdmc().unwrap(); /// ``` pub struct Archive { @@ -129,10 +129,10 @@ pub struct Archive { /// use std::io::prelude::*; /// use ctru::services::fs::{Fs, File}; /// -/// let fs = Fs::init()?; -/// let sdmc = fs.sdmc()?; +/// let mut fs = Fs::init()?; +/// let mut sdmc = fs.sdmc()?; /// -/// let mut file = File::create(&sdmc, "/foo.txt")?; +/// let mut file = File::create(&mut sdmc, "/foo.txt")?; /// file.write_all(b"Hello, world!")?; /// # /// # Ok(()) @@ -148,8 +148,8 @@ pub struct Archive { /// use std::io::prelude::*; /// use ctru::services::fs::{Fs, File}; /// -/// let fs = Fs::init()?; -/// let sdmc = fs.sdmc()?; +/// let mut fs = Fs::init()?; +/// let mut sdmc = fs.sdmc()?; /// /// let mut file = File::open(&sdmc, "/foo.txt")?; /// let mut contents = String::new(); @@ -171,8 +171,8 @@ pub struct Archive { /// use std::io::prelude::*; /// use ctru::services::fs::{Fs, File}; /// -/// let fs = Fs::init()?; -/// let sdmc = fs.sdmc()?; +/// let mut fs = Fs::init()?; +/// let mut sdmc = fs.sdmc()?; /// /// let file = File::open(&sdmc, "/foo.txt")?; /// let mut buf_reader = BufReader::new(file); @@ -227,8 +227,8 @@ pub struct Metadata { /// ```no_run /// use ctru::services::fs::{Fs, OpenOptions}; /// -/// let fs = Fs::init().unwrap(); -/// let sdmc_archive = fs.sdmc().unwrap(); +/// let mut fs = Fs::init().unwrap(); +/// let mut sdmc_archive = fs.sdmc().unwrap(); /// let file = OpenOptions::new() /// .read(true) /// .archive(&sdmc_archive) @@ -242,8 +242,8 @@ pub struct Metadata { /// ```no_run /// use ctru::services::fs::{Fs, OpenOptions}; /// -/// let fs = Fs::init().unwrap(); -/// let sdmc_archive = fs.sdmc().unwrap(); +/// let mut fs = Fs::init().unwrap(); +/// let mut sdmc_archive = fs.sdmc().unwrap(); /// let file = OpenOptions::new() /// .read(true) /// .write(true) @@ -369,8 +369,8 @@ impl File { /// ```no_run /// use ctru::services::fs::{Fs, File}; /// - /// let fs = Fs::init().unwrap(); - /// let sdmc_archive = fs.sdmc().unwrap(); + /// let mut fs = Fs::init().unwrap(); + /// let mut sdmc_archive = fs.sdmc().unwrap(); /// let mut f = File::open(&sdmc_archive, "/foo.txt").unwrap(); /// ``` pub fn open>(arch: &Archive, path: P) -> IoResult { @@ -398,9 +398,9 @@ impl File { /// ```no_run /// use ctru::services::fs::{Fs, File}; /// - /// let fs = Fs::init().unwrap(); - /// let sdmc_archive = fs.sdmc().unwrap(); - /// let mut f = File::create(&sdmc_archive, "/foo.txt").unwrap(); + /// let mut fs = Fs::init().unwrap(); + /// let mut sdmc_archive = fs.sdmc().unwrap(); + /// let mut f = File::create(&mut sdmc_archive, "/foo.txt").unwrap(); /// ``` pub fn create>(arch: &mut Archive, path: P) -> IoResult { OpenOptions::new()