diff --git a/src/pxar.rs b/src/pxar.rs index 286b572b..b9c6ac38 100644 --- a/src/pxar.rs +++ b/src/pxar.rs @@ -68,7 +68,7 @@ pub use decoder::*; mod exclude_pattern; pub use exclude_pattern::*; -mod dir_buffer; -pub use dir_buffer::*; +mod dir_stack; +pub use dir_stack::*; mod helper; diff --git a/src/pxar/dir_buffer.rs b/src/pxar/dir_stack.rs similarity index 98% rename from src/pxar/dir_buffer.rs rename to src/pxar/dir_stack.rs index 54a51284..ade418f5 100644 --- a/src/pxar/dir_buffer.rs +++ b/src/pxar/dir_stack.rs @@ -17,7 +17,7 @@ pub struct PxarDir { pub dir: Option, } -pub struct PxarDirBuf { +pub struct PxarDirStack { root: RawFd, data: Vec, } @@ -56,7 +56,7 @@ impl PxarDir { } } -impl PxarDirBuf { +impl PxarDirStack { pub fn new(parent: RawFd) -> Self { Self { root: parent, diff --git a/src/pxar/sequential_decoder.rs b/src/pxar/sequential_decoder.rs index 49c867fd..f97d8254 100644 --- a/src/pxar/sequential_decoder.rs +++ b/src/pxar/sequential_decoder.rs @@ -8,7 +8,7 @@ use endian_trait::Endian; use super::flags; use super::format_definition::*; use super::exclude_pattern::*; -use super::dir_buffer::*; +use super::dir_stack::*; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; @@ -626,7 +626,7 @@ impl <'a, R: Read, F: Fn(&Path) -> Result<(), Error>> SequentialDecoder<'a, R, F fn restore_dir( &mut self, base_path: &Path, - dirs: &mut PxarDirBuf, + dirs: &mut PxarDirStack, entry: PxarEntry, filename: &OsStr, matched: MatchType, @@ -682,7 +682,7 @@ impl <'a, R: Read, F: Fn(&Path) -> Result<(), Error>> SequentialDecoder<'a, R, F let dir = nix::dir::Dir::open(path, nix::fcntl::OFlag::O_DIRECTORY, nix::sys::stat::Mode::empty()) .map_err(|err| format_err!("unable to open target directory {:?} - {}", path, err))?; let fd = dir.as_raw_fd(); - let mut dirs = PxarDirBuf::new(fd); + let mut dirs = PxarDirStack::new(fd); // An empty match pattern list indicates to restore the full archive. let matched = if match_pattern.len() == 0 { MatchType::Include @@ -722,7 +722,7 @@ impl <'a, R: Read, F: Fn(&Path) -> Result<(), Error>> SequentialDecoder<'a, R, F fn restore_dir_entry( &mut self, base_path: &Path, - dirs: &mut PxarDirBuf, + dirs: &mut PxarDirStack, filename: &OsStr, parent_matched: MatchType, match_pattern: &Vec,