Skip to content

Commit

Permalink
Fix mutability issues after merge of master
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-h-chamberlain committed Apr 14, 2023
1 parent a111268 commit 7d70add
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions ctru-rs/src/services/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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(())
Expand All @@ -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();
Expand All @@ -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);
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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<P: AsRef<Path>>(arch: &Archive, path: P) -> IoResult<File> {
Expand Down Expand Up @@ -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<P: AsRef<Path>>(arch: &mut Archive, path: P) -> IoResult<File> {
OpenOptions::new()
Expand Down

0 comments on commit 7d70add

Please sign in to comment.