From 19e8b828258a26ebb71e67be4b9053fe8ba76ee2 Mon Sep 17 00:00:00 2001 From: Michael Daffin Date: Tue, 1 Jun 2021 09:57:57 +0100 Subject: [PATCH] Remove mut from with and AttachOptions to make it consistant with the other methods --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 7efeb21..d8780b7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -156,7 +156,7 @@ impl LoopDevice { /// ld.with().part_scan(true).attach("disk.img").unwrap(); /// # ld.detach().unwrap(); /// ``` - pub fn with(&mut self) -> AttachOptions<'_> { + pub fn with(&self) -> AttachOptions<'_> { AttachOptions { device: self, info: Default::default(), @@ -379,12 +379,12 @@ impl LoopDevice { /// ld.with() /// .offset(1024*1024) /// .size_limit(1024*1024*1024) -/// .attach("test.img") +/// .attach("disk.img") /// .unwrap(); /// # ld.detach().unwrap(); /// ``` pub struct AttachOptions<'d> { - device: &'d mut LoopDevice, + device: &'d LoopDevice, info: loop_info64, direct_io: bool, }