diff options
author | Matthew Schauer <matthew.schauer@e10x.net> | 2022-10-27 10:29:27 -0700 |
---|---|---|
committer | Matthew Schauer <matthew.schauer@e10x.net> | 2022-10-27 10:29:27 -0700 |
commit | 5c533ae5237fddeab8c9e9da000d123c9aab46f3 (patch) | |
tree | 225066cf1bc732eabd9339d7ae2b966085652f00 | |
parent | b7684c5a4c0f34003c7ee96f03fab4fa4c11aeb5 (diff) |
Rename library in preparation for upload
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | src/read.rs | 7 |
2 files changed, 7 insertions, 4 deletions
@@ -1,6 +1,6 @@ [package] -name = "squashfs" -version = "0.1.0" +name = "squashfs-ng" +version = "0.1.1" authors = ["Matthew Schauer <matthew.schauer@e10x.net>"] edition = "2018" diff --git a/src/read.rs b/src/read.rs index 9a3a6c1..17f2595 100644 --- a/src/read.rs +++ b/src/read.rs @@ -61,7 +61,7 @@ struct Leased<'a, T> { impl<'a, T> Leased<'a, T> { pub fn new(pool: &'a Mutex<Vec<T>>, data: T) -> Self { - Self { pool: pool, data: ManuallyDrop::new(data) } + Self { pool, data: ManuallyDrop::new(data) } } } @@ -103,6 +103,9 @@ impl<'a, T> Drop for Leased<'a, T> { #[derive(Debug)] pub struct Dir<'a> { node: &'a Node<'a>, + // TODO I believe this unread field is necessary so we don't drop the compressor instance that + // the reader uses. 1) Verify this. 2) Can we represent this dependency in such a way the + // Rust won't warn about not using this field? compressor: ManagedPointer<sqfs_compressor_t>, reader: Mutex<ManagedPointer<sqfs_dir_reader_t>>, } @@ -114,7 +117,7 @@ impl<'a> Dir<'a> { sqfs_dir_reader_create(&node.container.superblock, *compressor, *node.container.file, 0) }, "Couldn't create directory reader", sfs_destroy)?; unsafe { sfs_check(sqfs_dir_reader_open_dir(*reader, node.inode.as_const(), 0), "Couldn't open directory")?; } - Ok(Self { node: node, compressor: compressor, reader: Mutex::new(reader) }) + Ok(Self {node, compressor, reader: Mutex::new(reader) }) } /// Reset the directory reader to the beginning of the directory. |