Skip to content

Commit

Permalink
Removes deprecated methods (#40)
Browse files Browse the repository at this point in the history
* Removes deprecated methods

* Bumps version to 0.3.0
  • Loading branch information
mdaffin authored Jul 2, 2021
1 parent 0108b3c commit 8453a6d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 59 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "loopdev"
description = "Setup and control loop devices"
version = "0.2.2"
version = "0.3.0"
authors = ["Michael Daffin <[email protected]>"]
license = "MIT"
documentation = "https://docs.rs/loopdev"
Expand Down
58 changes: 0 additions & 58 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,6 @@ impl LoopDevice {
}
}

/// Attach the loop device to a file starting at offset into the file.
#[deprecated(
since = "0.2.0",
note = "use `loop.with().offset(offset).attach(file)` instead"
)]
pub fn attach<P: AsRef<Path>>(&self, backing_file: P, offset: u64) -> io::Result<()> {
let info = loop_info64 {
lo_offset: offset,
..Default::default()
};

Self::attach_with_loop_info(self, backing_file, info)
}

/// Attach the loop device to a file that maps to the whole file.
///
/// # Examples
Expand All @@ -201,44 +187,6 @@ impl LoopDevice {
Self::attach_with_loop_info(self, backing_file, info)
}

/// Attach the loop device to a file starting at offset into the file.
#[deprecated(
since = "0.2.2",
note = "use `loop.with().offset(offset).attach(file)` instead"
)]
pub fn attach_with_offset<P: AsRef<Path>>(
&self,
backing_file: P,
offset: u64,
) -> io::Result<()> {
let info = loop_info64 {
lo_offset: offset,
..Default::default()
};

Self::attach_with_loop_info(self, backing_file, info)
}

/// Attach the loop device to a file starting at offset into the file and a the given sizelimit.
#[deprecated(
since = "0.2.2",
note = "use `with().size_limit(size).attach(file)` instead"
)]
pub fn attach_with_sizelimit<P: AsRef<Path>>(
&self,
backing_file: P,
offset: u64,
size_limit: u64,
) -> io::Result<()> {
let info = loop_info64 {
lo_offset: offset,
lo_sizelimit: size_limit,
..Default::default()
};

Self::attach_with_loop_info(self, backing_file, info)
}

/// Attach the loop device to a file with loop_info64.
fn attach_with_loop_info(
&self, // TODO should be mut? - but changing it is a breaking change
Expand Down Expand Up @@ -280,12 +228,6 @@ impl LoopDevice {
}
}

/// Get the path of the loop device.
#[deprecated(since = "0.2.0", note = "use `path` instead")]
pub fn get_path(&self) -> Option<PathBuf> {
self.path()
}

/// Get the path of the loop device.
pub fn path(&self) -> Option<PathBuf> {
let mut p = PathBuf::from("/proc/self/fd");
Expand Down

0 comments on commit 8453a6d

Please sign in to comment.