aboutsummaryrefslogtreecommitdiff
path: root/src/raw/mod.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2020-05-01 18:02:50 +0200
committerDaniel Schadt <kingdread@gmx.de>2020-05-01 18:02:50 +0200
commit896b31f02f67fe5c02b7fbe5fba08c9f9f34c023 (patch)
tree6b5f06ea1913b1c6021c198979f2ed1d43ac119f /src/raw/mod.rs
parent6f197788a75f0b89b8729292a50eba2687efa21e (diff)
downloadevtclib-896b31f02f67fe5c02b7fbe5fba08c9f9f34c023.tar.gz
evtclib-896b31f02f67fe5c02b7fbe5fba08c9f9f34c023.tar.bz2
evtclib-896b31f02f67fe5c02b7fbe5fba08c9f9f34c023.zip
take readers by value
The API guidelines for Rust state that readers should be taken by value[1]. If the caller wants to re-use the reader, they have to borrow it. This patch adjusts the parsing functions to do just that. [1]: https://rust-lang.github.io/api-guidelines/interoperability.html#generic-readerwriter-functions-take-r-read-and-w-write-by-value-c-rw-value
Diffstat (limited to 'src/raw/mod.rs')
-rw-r--r--src/raw/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/raw/mod.rs b/src/raw/mod.rs
index 88b58ac..77a8571 100644
--- a/src/raw/mod.rs
+++ b/src/raw/mod.rs
@@ -21,7 +21,7 @@ use std::ffi::CStr;
use std::io::{BufReader, Read, Seek};
/// Parse a complete log that was compressed as a zip file.
-pub fn parse_zip<T: Read + Seek>(input: &mut T) -> ParseResult<Evtc> {
+pub fn parse_zip<R: Read + Seek>(input: R) -> ParseResult<Evtc> {
let mut archive = ZipArchive::new(input)?;
let mut file = BufReader::new(archive.by_index(0)?);
parse_file(&mut file)