From 2f366ce970d02f45afbfb6c4acb9b9ca93384df1 Mon Sep 17 00:00:00 2001 From: Wonwoo Choi Date: Fri, 20 Sep 2024 01:03:01 +0900 Subject: [PATCH] Remove unused method `finish` --- jxl/src/container/mod.rs | 10 ++-------- jxl/src/container/parse.rs | 3 +-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/jxl/src/container/mod.rs b/jxl/src/container/mod.rs index c21d85c..7542438 100644 --- a/jxl/src/container/mod.rs +++ b/jxl/src/container/mod.rs @@ -9,8 +9,8 @@ pub mod box_header; pub mod parse; use box_header::*; -use parse::*; pub use parse::ParseEvent; +use parse::*; /// Container format parser. #[derive(Debug, Default)] @@ -35,7 +35,6 @@ enum DetectState { kind: BitstreamKind, bytes_left: Option, }, - Done(BitstreamKind), } /// Structure of the decoded bitstream. @@ -71,7 +70,7 @@ impl ContainerParser { DetectState::WaitingBoxHeader | DetectState::WaitingJxlpIndex(..) | DetectState::InAuxBox { .. } => BitstreamKind::Container, - DetectState::InCodestream { kind, .. } | DetectState::Done(kind) => kind, + DetectState::InCodestream { kind, .. } => kind, } } @@ -96,11 +95,6 @@ impl ContainerParser { pub fn previous_consumed_bytes(&self) -> usize { self.previous_consumed_bytes } - - pub fn finish(&mut self) { - // FIXME: validate state - self.state = DetectState::Done(self.kind()); - } } #[cfg(test)] diff --git a/jxl/src/container/parse.rs b/jxl/src/container/parse.rs index b386e94..7092136 100644 --- a/jxl/src/container/parse.rs +++ b/jxl/src/container/parse.rs @@ -5,7 +5,7 @@ // // Originally written for jxl-oxide. -use super::{box_header::*, DetectState, JxlpIndexState, BitstreamKind, ContainerParser}; +use super::{box_header::*, BitstreamKind, ContainerParser, DetectState, JxlpIndexState}; use crate::error::{Error, Result}; /// Iterator that reads over a buffer and emits parser events. @@ -210,7 +210,6 @@ impl<'inner, 'buf> ParseEvents<'inner, 'buf> { }; // FIXME: emit auxiliary box event } - DetectState::Done(_) => return Ok(None), } } }