From 7849fc2b1a3cf8060ce661dd2780f1b783aa3d35 Mon Sep 17 00:00:00 2001 From: Jan Starke Date: Wed, 23 Aug 2023 14:06:38 +0200 Subject: [PATCH] add support for &File --- Cargo.toml | 2 +- src/transactionlog/mod.rs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 123f339..e149304 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nt_hive2" -version = "4.0.0" +version = "4.0.1" edition = "2021" authors = ["Jan Starke ", "Muteb Alqahtani "] license = "GPL-3.0" diff --git a/src/transactionlog/mod.rs b/src/transactionlog/mod.rs index 4291a35..6173f50 100644 --- a/src/transactionlog/mod.rs +++ b/src/transactionlog/mod.rs @@ -71,6 +71,14 @@ impl TryFrom for TransactionLog { } } +impl TryFrom<&mut File> for TransactionLog { + type Error = binread::Error; + + fn try_from(file: &mut File) -> Result { + file.read_le::() + } +} + impl IntoIterator for TransactionLog { type Item = TransactionLogsEntry;