Ran clippy

This commit is contained in:
Nathan Fisher 2023-03-23 14:53:43 -04:00
parent 85a85a3810
commit c3324f203b
2 changed files with 2 additions and 3 deletions

View File

@ -26,11 +26,10 @@ impl Item {
for c in res {
write!(sha256sum, "{c:02x}")?;
}
let node = Node::read_data_to_tar(&data, &filename, &meta, owner)?;
let mode = meta.mode();
Ok(Self {
entry: Entry::File { path, sha256sum, mode, size },
node,
node: Node::read_data_to_tar(&data, &filename, &meta, owner)?,
})
} else if meta.is_dir() {
let mode = meta.mode();

View File

@ -272,7 +272,7 @@ impl Header {
header.mtime[..mtime.len()].copy_from_slice(mtime.as_bytes());
header.link_indicator[0] = FileType::from(meta) as u8;
if header.link_indicator[0] == FileType::Symlink as u8 {
let link = fs::read_link(&filename)?.to_str().unwrap().to_string();
let link = fs::read_link(filename)?.to_str().unwrap().to_string();
header.link_name[..link.len()].copy_from_slice(link.as_bytes());
} else if header.link_indicator[0] == FileType::Block as u8 {
let major = format!("{:07o}", meta.st_dev());