Remove opinionated Display impl for file::Class
This type derives Debug, so you can "{:?}" format it to get a string like ELF32/ELF64, which is intuitive to me. If someone wants some other human readable format, they can implement it themselves.
This commit is contained in:
parent
2e05d70302
commit
4875ff8981
10
src/file.rs
10
src/file.rs
@ -10,16 +10,6 @@ pub enum Class {
|
||||
ELF64,
|
||||
}
|
||||
|
||||
impl core::fmt::Display for Class {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
|
||||
let str = match self {
|
||||
Class::ELF32 => "32-bit",
|
||||
Class::ELF64 => "64-bit",
|
||||
};
|
||||
write!(f, "{}", str)
|
||||
}
|
||||
}
|
||||
|
||||
/// Encapsulates the contents of the ELF File Header
|
||||
///
|
||||
/// The ELF File Header starts off every ELF file and both identifies the
|
||||
|
Loading…
x
Reference in New Issue
Block a user