Skip to content

Commit

Permalink
chore: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
hschimke committed Jul 31, 2024
1 parent 9c83c91 commit 628b1ec
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
7 changes: 4 additions & 3 deletions benches/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use rxing::oned::{
};
use rxing::pdf417::PDF417Reader;
use rxing::qrcode::QRCodeReader;
use rxing::{FilteredImageReader, MultiFormatReader};
use rxing::{BinaryBitmap, BufferedImageLuminanceSource, Reader};
use rxing::{FilteredImageReader, MultiFormatReader};
use std::path::Path;

fn get_image(
Expand Down Expand Up @@ -210,8 +210,9 @@ fn multi_barcode_filtered_reader_benchmark(c: &mut Criterion) {
let mut image = get_image("test_resources/blackbox/multi-1/1.png");
c.bench_function("multi_barcode", |b| {
b.iter(|| {

let mut reader = GenericMultipleBarcodeReader::new(FilteredImageReader::new(MultiFormatReader::default()));
let mut reader = GenericMultipleBarcodeReader::new(FilteredImageReader::new(
MultiFormatReader::default(),
));
let _res = reader.decode_multiple(&mut image);
});
});
Expand Down
8 changes: 6 additions & 2 deletions src/common/cpp_essentials/edge_tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ impl<'a> EdgeTracer<'_> {
if history
.read()
.map_err(|_| {
Exceptions::illegal_state_with("Failed to acquire read lock")
Exceptions::illegal_state_with(
"Failed to acquire read lock",
)
})?
.get(self.p.x as u32, self.p.y as u32)
== self.state as u8
Expand All @@ -242,7 +244,9 @@ impl<'a> EdgeTracer<'_> {
history
.write()
.map_err(|_| {
Exceptions::illegal_state_with("Failed to acquire write lock")
Exceptions::illegal_state_with(
"Failed to acquire write lock",
)
})?
.set(self.p.x as u32, self.p.y as u32, self.state as u8);
}
Expand Down
3 changes: 1 addition & 2 deletions src/oned/one_d_code_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


use crate::{
common::{BitMatrix, Result},
BarcodeFormat, Exceptions, Writer,
Expand Down Expand Up @@ -140,4 +139,4 @@ pub trait OneDimensionalCodeWriter: Writer {
// This seems like a decent idea for a default for all formats.
10
}
}
}
6 changes: 2 additions & 4 deletions tests/github_issues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ fn test_issue_49() {
assert_eq!(EXPECTED_ITF_TEXT, itf_result.getText());
}


#[cfg(feature = "image")]
#[test]
fn test_issue_50() {
Expand Down Expand Up @@ -481,14 +480,14 @@ fn test_issue_50_2() {
assert_eq!(EXPECTED_FORMAT, result.getBarcodeFormat());
}


#[cfg(feature = "image")]
#[test]
fn issue_51_multiple_detection() {
use image::DynamicImage;
use rxing::{
common::HybridBinarizer,
multi::{GenericMultipleBarcodeReader, MultipleBarcodeReader}, BinaryBitmap, BufferedImageLuminanceSource, DecodeHintType, DecodeHintValue,
multi::{GenericMultipleBarcodeReader, MultipleBarcodeReader},
BinaryBitmap, BufferedImageLuminanceSource, DecodeHintType, DecodeHintValue,
DecodingHintDictionary, Exceptions, MultiUseMultiFormatReader,
};

Expand Down Expand Up @@ -554,4 +553,3 @@ fn issue_51_multiple_detection() {
results.len()
);
}

0 comments on commit 628b1ec

Please sign in to comment.