chore: cpio: add debug formatter for Entry

This commit is contained in:
Paul Pan 2024-06-02 01:09:30 +08:00
parent 6b770c4aea
commit d89a21648f

View File

@ -151,6 +151,17 @@ impl Entry {
} }
} }
impl core::fmt::Debug for Entry {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("Entry")
.field("filename", &self.filename())
.field("file_size", &self.file_size())
.field("is_tailer", &self.is_trailer())
.field("is_valid", &self.is_valid())
.finish()
}
}
impl<'a> Reader<'a> { impl<'a> Reader<'a> {
pub fn new(data: &'a [u8]) -> Self { pub fn new(data: &'a [u8]) -> Self {
Reader { data } Reader { data }