Skip to content

Commit

Permalink
chore: clippy updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hschimke committed Jul 25, 2024
1 parent 8f7bd24 commit b9864ff
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ otsu_level = ["image"]
#/// Adds "client" features do decode many common data formats found in barcodes
client_support = []

#/// For the `FilteredImageReader` if this feature is enabled it
#/// will always reverse the order of pyramid scans
reverse_pyramid_layers = []

[workspace]
members = [
"crates/one-d-proc-derive",
Expand Down
2 changes: 1 addition & 1 deletion src/datamatrix/data_matrix_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl Reader for DataMatrixReader {
let decoded = DECODER.decode(symbol.getBits());
if decoded.is_ok() {
points = symbol.getPoints().to_vec();
return Ok(decoded?);
return decoded;
} else {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::{cell::RefCell, rc::Rc};

use crate::{
common::{
cpp_essentials::RegressionLineTrait, BitMatrix, DefaultGridSampler, DetectorRXingResult,
cpp_essentials::RegressionLineTrait, BitMatrix, DefaultGridSampler,
GridSampler, Quadrilateral, Result,
},
datamatrix::detector::{
Expand Down
1 change: 1 addition & 0 deletions src/datamatrix/encoder/minimal_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ impl Edge {
* - Mode is EDIFACT and characterLength is less than 4 or the remaining characters can be encoded in at most 2
* ASCII bytes.
* - Mode is C40, TEXT or X12 and the remaining characters can be encoded in at most 1 ASCII byte.
*
* Returns mode in all other cases.
* */
pub fn getEndMode(&self) -> Result<Mode> {
Expand Down
2 changes: 1 addition & 1 deletion src/filtered_image_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl LumImagePyramid {
new_self.add_layer_with_factor(factor).ok()?;
}

#[cfg(reverse_pyramid_layers)]
#[cfg(feature = "reverse_pyramid_layers")]
// Reversing the layers means we'd start with the smallest. that can make sense if we are only looking for a
// single symbol. If we start with the higher resolution, we get better (high res) position information.
// TODO: see if masking out higher res layers based on found symbols in lower res helps overall performance.
Expand Down
3 changes: 1 addition & 2 deletions tests/github_issues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,7 @@ fn issue_51_multiple_detection() {
use image::DynamicImage;
use rxing::{
common::HybridBinarizer,
multi::{GenericMultipleBarcodeReader, MultipleBarcodeReader},
BarcodeFormat, BinaryBitmap, BufferedImageLuminanceSource, DecodeHintType, DecodeHintValue,
multi::{GenericMultipleBarcodeReader, MultipleBarcodeReader}, BinaryBitmap, BufferedImageLuminanceSource, DecodeHintType, DecodeHintValue,
DecodingHintDictionary, Exceptions, MultiUseMultiFormatReader,
};

Expand Down

0 comments on commit b9864ff

Please sign in to comment.