clippy --fix

This commit is contained in:
Henry Schimke
2023-01-05 11:32:10 -06:00
parent b375e04160
commit b69f23711c
15 changed files with 21 additions and 24 deletions

View File

@@ -16,7 +16,7 @@
//package com.google.zxing;
use std::{cell::RefCell, rc::Rc, borrow::Cow};
use std::{rc::Rc, borrow::Cow};
use crate::{
common::{BitArray, BitMatrix},

View File

@@ -16,7 +16,7 @@
//package com.google.zxing;
use std::{cell::RefCell, fmt, rc::Rc, borrow::Cow};
use std::{fmt, rc::Rc, borrow::Cow};
use crate::{
common::{BitArray, BitMatrix},
@@ -47,14 +47,14 @@ impl BinaryBitmap {
* @return The width of the bitmap.
*/
pub fn getWidth(&self) -> usize {
return self.binarizer.getWidth();
self.binarizer.getWidth()
}
/**
* @return The height of the bitmap.
*/
pub fn getHeight(&self) -> usize {
return self.binarizer.getHeight();
self.binarizer.getHeight()
}
/**

View File

@@ -20,7 +20,7 @@
// import com.google.zxing.LuminanceSource;
// import com.google.zxing.NotFoundException;
use std::{cell::RefCell, rc::Rc, borrow::Cow};
use std::{rc::Rc, borrow::Cow};
use once_cell::unsync::OnceCell;

View File

@@ -20,7 +20,7 @@
// import com.google.zxing.LuminanceSource;
// import com.google.zxing.NotFoundException;
use std::{cell::RefCell, rc::Rc, borrow::Cow};
use std::{rc::Rc, borrow::Cow};
use once_cell::unsync::OnceCell;

View File

@@ -1,5 +1,4 @@
use std::{
cell::RefCell,
collections::{HashMap, HashSet},
rc::Rc,
};

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
use std::{cell::RefCell, collections::HashSet, path::PathBuf, rc::Rc};
use std::{collections::HashSet, path::PathBuf, rc::Rc};
use crate::{
common::HybridBinarizer, BarcodeFormat, BinaryBitmap, BufferedImageLuminanceSource,

View File

@@ -222,7 +222,7 @@ mod multi_qr_code_test_case {
* limitations under the License.
*/
use std::{cell::RefCell, collections::HashSet, path::PathBuf, rc::Rc};
use std::{collections::HashSet, path::PathBuf, rc::Rc};
use image;

View File

@@ -24,7 +24,7 @@
* http://www.piramidepse.com/
*/
use std::{cell::RefCell, rc::Rc};
use std::{rc::Rc};
/**
* @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
@@ -174,7 +174,7 @@ fn assertCorrectImage2binary(fileName: &str, expected: &str) {
let path = format!("test_resources/blackbox/rssexpanded-1/{}", fileName);
let image = image::open(path).expect("file exists");
let mut binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
let binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
Box::new(BufferedImageLuminanceSource::new(image)),
)));
let rowNumber = binaryMap.getHeight() / 2;

View File

@@ -29,7 +29,7 @@
*
*/
use std::{cell::RefCell, collections::HashMap, rc::Rc};
use std::{collections::HashMap, rc::Rc};
use crate::{
client::result::{ExpandedProductParsedRXingResult, ParsedClientResult},
@@ -71,7 +71,7 @@ fn assertCorrectImage2result(fileName: &str, expected: ExpandedProductParsedRXin
let path = format!("test_resources/blackbox/rssexpanded-1/{}", fileName);
let image = image::open(path).expect("image must exist");
let mut binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
let binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
Box::new(BufferedImageLuminanceSource::new(image)),
)));
let rowNumber = binaryMap.getHeight() / 2;

View File

@@ -24,7 +24,7 @@
* http://www.piramidepse.com/
*/
use std::{cell::RefCell, collections::HashMap, rc::Rc};
use std::{collections::HashMap, rc::Rc};
use crate::{
common::GlobalHistogramBinarizer,
@@ -184,7 +184,7 @@ fn assertCorrectImage2string(fileName: &str, expected: &str) {
let path = format!("test_resources/blackbox/rssexpanded-1/{}", fileName);
let image = image::open(path).expect("load image");
let mut binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
let binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
Box::new(BufferedImageLuminanceSource::new(image)),
)));
let rowNumber = binaryMap.getHeight() / 2;

View File

@@ -24,7 +24,7 @@
* http://www.piramidepse.com/
*/
use std::{cell::RefCell, rc::Rc};
use std::{rc::Rc};
use crate::{
common::GlobalHistogramBinarizer,
@@ -42,7 +42,7 @@ use super::RSSExpandedReader;
#[test]
fn testFindFinderPatterns() {
let image = readImage("2.png");
let mut binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
let binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
Box::new(BufferedImageLuminanceSource::new(image)),
)));
let rowNumber = binaryMap.getHeight() as u32 / 2;
@@ -88,7 +88,7 @@ fn testFindFinderPatterns() {
#[test]
fn testRetrieveNextPairPatterns() {
let image = readImage("3.png");
let mut binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
let binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
Box::new(BufferedImageLuminanceSource::new(image)),
)));
let rowNumber = binaryMap.getHeight() as u32 / 2;
@@ -116,7 +116,7 @@ fn testRetrieveNextPairPatterns() {
#[test]
fn testDecodeCheckCharacter() {
let image = readImage("3.png");
let mut binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
let binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
Box::new(BufferedImageLuminanceSource::new(image.clone())),
)));
let row = binaryMap
@@ -144,7 +144,7 @@ fn testDecodeCheckCharacter() {
#[test]
fn testDecodeDataCharacter() {
let image = readImage("3.png");
let mut binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
let binaryMap = BinaryBitmap::new(Rc::new(GlobalHistogramBinarizer::new(
Box::new(BufferedImageLuminanceSource::new(image.clone())),
)));
let row = binaryMap

View File

@@ -36,7 +36,7 @@ use super::{test_case_util, RSSExpandedReader};
fn testDecodingRowByRow() {
let mut rssExpandedReader = RSSExpandedReader::new();
let mut binaryMap = test_case_util::getBinaryBitmap("1000.png");
let binaryMap = test_case_util::getBinaryBitmap("1000.png");
let firstRowNumber = binaryMap.getHeight() / 3;
let firstRow = binaryMap.getBlackRow(firstRowNumber).expect("get row");

View File

@@ -24,7 +24,7 @@
* http://www.piramidepse.com/
*/
use std::{cell::RefCell, rc::Rc};
use std::{rc::Rc};
use image::DynamicImage;

View File

@@ -16,7 +16,6 @@
*/
use std::{
cell::RefCell,
collections::HashMap,
fs::{read_dir, read_to_string, File},
io::Read,

View File

@@ -16,7 +16,6 @@
*/
use std::{
cell::RefCell,
collections::HashMap,
fs::{read_dir, read_to_string, File},
io::Read,