From f50b4fd6a0c6f58da8e2726affa1a496dcd20052 Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Tue, 13 Aug 2019 14:50:12 +0200 Subject: [PATCH] src/pxar/decoder.rs: cleanup s/CaDirectoryEntry/DirectoryEntry Signed-off-by: Christian Ebner --- src/pxar/decoder.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pxar/decoder.rs b/src/pxar/decoder.rs index 6bb160d9..c8e3b9d3 100644 --- a/src/pxar/decoder.rs +++ b/src/pxar/decoder.rs @@ -13,7 +13,7 @@ use std::path::{Path, PathBuf}; use std::ffi::OsString; -pub struct CaDirectoryEntry { +pub struct DirectoryEntry { start: u64, end: u64, pub filename: OsString, @@ -42,8 +42,8 @@ impl <'a, R: Read + Seek, F: Fn(&Path) -> Result<(), Error>> Decoder<'a, R, F> { }) } - pub fn root(&self) -> CaDirectoryEntry { - CaDirectoryEntry { + pub fn root(&self) -> DirectoryEntry { + DirectoryEntry { start: self.root_start, end: self.root_end, filename: OsString::new(), // Empty @@ -64,7 +64,7 @@ impl <'a, R: Read + Seek, F: Fn(&Path) -> Result<(), Error>> Decoder<'a, R, F> { pub fn restore( &mut self, - dir: &CaDirectoryEntry, + dir: &DirectoryEntry, path: &Path, ) -> Result<(), Error> { let start = dir.start; @@ -76,7 +76,7 @@ impl <'a, R: Read + Seek, F: Fn(&Path) -> Result<(), Error>> Decoder<'a, R, F> { Ok(()) } - fn read_directory_entry(&mut self, start: u64, end: u64) -> Result { + fn read_directory_entry(&mut self, start: u64, end: u64) -> Result { self.seek(SeekFrom::Start(start))?; @@ -94,7 +94,7 @@ impl <'a, R: Read + Seek, F: Fn(&Path) -> Result<(), Error>> Decoder<'a, R, F> { check_ca_header::(&head, PXAR_ENTRY)?; let entry: PxarEntry = self.inner.read_item()?; - Ok(CaDirectoryEntry { + Ok(DirectoryEntry { start: entry_start, end: end, filename: filename, @@ -102,7 +102,7 @@ impl <'a, R: Read + Seek, F: Fn(&Path) -> Result<(), Error>> Decoder<'a, R, F> { }) } - pub fn list_dir(&mut self, dir: &CaDirectoryEntry) -> Result, Error> { + pub fn list_dir(&mut self, dir: &DirectoryEntry) -> Result, Error> { const GOODBYE_ITEM_SIZE: u64 = std::mem::size_of::() as u64; @@ -185,7 +185,7 @@ impl <'a, R: Read + Seek, F: Fn(&Path) -> Result<(), Error>> Decoder<'a, R, F> { &mut self, output: &mut W, prefix: &mut PathBuf, - dir: &CaDirectoryEntry, + dir: &DirectoryEntry, ) -> Result<(), Error> { let mut list = self.list_dir(dir)?;