Skip to content

Commit a8e437a

Browse files
committed
Fix clippy (no feature)
1 parent e018ee0 commit a8e437a

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

jxl/src/api/inner/codestream_parser/sections.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ impl CodestreamParser {
4545
#[cfg(feature = "jpeg-reconstruction")] box_parser: &mut BoxParser,
4646
) -> Result<Option<usize>> {
4747
let frame = self.frame.as_mut().unwrap();
48-
let do_ycbcr = frame.header().do_ycbcr;
4948

5049
// Dequeue ready sections.
5150
while self
@@ -235,6 +234,7 @@ impl CodestreamParser {
235234
if let Some(frame) = self.frame.as_mut()
236235
&& let Some(coeffs) = frame.take_jpeg_coefficients()
237236
{
237+
let do_ycbcr = frame.header().do_ycbcr;
238238
// Merge coefficients into the jpeg_reconstruction data
239239
if let Some(ref mut jpeg_data) = box_parser.jpeg_reconstruction {
240240
jpeg_data.dct_coefficients = Some(coeffs);

jxl/src/frame/quant_weights.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,7 @@ impl DequantMatrices {
10591059
&self.table[self.table_offsets[quant_kind as usize * 3 + c]..]
10601060
}
10611061

1062+
#[cfg(feature = "jpeg-reconstruction")]
10621063
pub fn encodings(&self) -> &[QuantEncoding] {
10631064
&self.encodings
10641065
}

jxl_cli/src/main.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,16 @@ fn main() -> Result<()> {
179179
.map(|f| OutputFormat::from_output_filename(&f.to_string_lossy()))
180180
.transpose()?;
181181

182-
let (numpy_output, exr_output, jpeg_output) =
183-
match &opt.output.as_ref().map(|p| p.to_string_lossy()) {
184-
Some(path) => (
185-
path.ends_with(".npy"),
186-
path.ends_with(".exr"),
187-
is_jpeg_output(std::path::Path::new(path.as_ref())),
188-
),
189-
None => (false, false, false),
190-
};
182+
let output_path = opt.output.as_ref().map(|p| p.to_string_lossy());
183+
let (numpy_output, exr_output) = match &output_path {
184+
Some(path) => (path.ends_with(".npy"), path.ends_with(".exr")),
185+
None => (false, false),
186+
};
187+
#[cfg(feature = "jpeg-reconstruction")]
188+
let jpeg_output = match &output_path {
189+
Some(path) => is_jpeg_output(std::path::Path::new(path.as_ref())),
190+
None => false,
191+
};
191192
let high_precision = opt.high_precision;
192193
let options = |skip_preview: bool| {
193194
let mut options = JxlDecoderOptions::default();

0 commit comments

Comments
 (0)