Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacMarovitz committed Sep 22, 2023
1 parent c6aafe3 commit 2d9ba4a
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 110 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
/tests/pe
.DS_Store
/.idea
108 changes: 54 additions & 54 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ default = ["std"]
std = ["clap"]

[dependencies]
bytemuck = {version = "1.14.0", features = ["derive"]}
bytemuck = { version = "1.14.0", features = ["derive"] }
num-traits = { version = "0.2", default-features = false }
num-derive = "0.4"
bitflags = { version = "2.4.0", default-features = false }
chrono = { version = "0.4.31", default-features = false }
clap = { version = "4.4.3", features = ["cargo"], optional = true }
clap = { version = "4.4.4", features = ["cargo"], optional = true }

[dev-dependencies]
datatest-stable = "0.2.3"
Expand Down
6 changes: 3 additions & 3 deletions src/coff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::prelude::*;
/// COFF File Header (Object and Image)
#[derive(Copy, Clone, Pod, Zeroable, Default)]
#[repr(C)]
pub struct coff_file_header {
pub struct CoffFileHeader {
/// The number that identifies the type of target machine.
pub machine: u16,
/// The number of sections. This indicates the size of the section table, which immediately follows the headers.
Expand All @@ -28,7 +28,7 @@ pub struct coff_file_header {
pub characteristics: u16
}

impl fmt::Display for coff_file_header {
impl fmt::Display for CoffFileHeader {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let machine_type = self.get_machine_type()
.expect("Failed to get machine type");
Expand Down Expand Up @@ -182,7 +182,7 @@ impl str::FromStr for Characteristics {
}
}

impl coff_file_header {
impl CoffFileHeader {
/// Returns the machine type as an enum
pub fn get_machine_type(&self) -> Option<MachineTypes> {
MachineTypes::from_u16(self.machine)
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! # pe-parser: Blazing-fast, safe, Portable Executable parsing.
//!
//! `pe-parser` provides a safe Rust-y way to parse Portable Exectuables quickly.
//! `pe-parser` provides a safe Rust-y way to parse Portable Executables quickly.
//! - Everything parsed to native documented structs
//! - Secondary parsing functions raw data into native Rust types
//! - Every section can be printed with ease
Expand Down Expand Up @@ -58,7 +58,7 @@ pub enum Error {
MissingMagicNumber,
}

impl core::fmt::Display for Error {
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::OffsetOutOfRange => f.write_str("Offset out of range!"),
Expand Down
Loading

0 comments on commit 2d9ba4a

Please sign in to comment.