src/pxar/encoder.rs: avoid use of macro and initialize Vec with known capacity.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner 2020-01-08 10:46:56 +01:00 committed by Dietmar Maurer
parent 71da3d6a1b
commit ec906dcf19
1 changed files with 2 additions and 2 deletions

View File

@ -630,7 +630,7 @@ impl<'a, W: Write, C: BackupCatalogWriter> Encoder<'a, W, C> {
) -> Result<(), Error> { ) -> Result<(), Error> {
//println!("encode_dir: {:?} start {}", self.full_path(), self.writer_pos); //println!("encode_dir: {:?} start {}", self.full_path(), self.writer_pos);
let mut name_list = vec![]; let mut name_list = Vec::new();
let rawfd = dir.as_raw_fd(); let rawfd = dir.as_raw_fd();
@ -771,7 +771,7 @@ impl<'a, W: Write, C: BackupCatalogWriter> Encoder<'a, W, C> {
name_list.sort_unstable_by(|a, b| a.0.cmp(&b.0)); name_list.sort_unstable_by(|a, b| a.0.cmp(&b.0));
let mut goodbye_items = vec![]; let mut goodbye_items = Vec::with_capacity(name_list.len());
for (filename, stat, exclude_list) in name_list { for (filename, stat, exclude_list) in name_list {
let start_pos = self.writer_pos; let start_pos = self.writer_pos;