Skip to content

Commit

Permalink
add support for &File
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Starke committed Aug 23, 2023
1 parent 8ef0c3c commit 7849fc2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nt_hive2"
version = "4.0.0"
version = "4.0.1"
edition = "2021"
authors = ["Jan Starke <[email protected]>", "Muteb Alqahtani <[email protected]>"]
license = "GPL-3.0"
Expand Down
8 changes: 8 additions & 0 deletions src/transactionlog/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ impl TryFrom<File> for TransactionLog {
}
}

impl TryFrom<&mut File> for TransactionLog {
type Error = binread::Error;

fn try_from(file: &mut File) -> Result<Self, Self::Error> {
file.read_le::<TransactionLog>()
}
}

impl IntoIterator for TransactionLog {
type Item = TransactionLogsEntry;

Expand Down

0 comments on commit 7849fc2

Please sign in to comment.