aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2020-05-01 21:36:19 +0200
committerDaniel Schadt <kingdread@gmx.de>2020-05-01 21:36:19 +0200
commitd3e0d1bd58115f581cae6441c863ba85805007ff (patch)
tree34453ddfdde219d25df58d4406d328962447c65c
parent896b31f02f67fe5c02b7fbe5fba08c9f9f34c023 (diff)
downloadevtclib-d3e0d1bd58115f581cae6441c863ba85805007ff.tar.gz
evtclib-d3e0d1bd58115f581cae6441c863ba85805007ff.tar.bz2
evtclib-d3e0d1bd58115f581cae6441c863ba85805007ff.zip
add a comment about redundant closures
-rw-r--r--src/raw/parser.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/raw/parser.rs b/src/raw/parser.rs
index a9d8e8a..b7d6aad 100644
--- a/src/raw/parser.rs
+++ b/src/raw/parser.rs
@@ -412,7 +412,12 @@ pub fn parse_partial_file<R: Read>(mut input: R) -> ParseResult<PartialEvtc> {
///
/// * `partial` - The partial EVTC.
/// * `input` - The input stream.
+#[allow(clippy::redundant_closure)]
pub fn finish_parsing<R: Read>(partial: PartialEvtc, input: R) -> ParseResult<Evtc> {
+ // The following closures seem redundant, but they are needed to convice Rust that we can
+ // actually use parse_event_rev* here. That is because we require a lifetime bound of
+ // for<'r> fn(&'r mut R) -> ParseResult
+ // which we cannot get by just plugging in parse_event_rev*.
let events = match partial.header.revision {
0 => parse_events(input, |r| parse_event_rev0(r))?,
1 => parse_events(input, |r| parse_event_rev1(r))?,