mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-25 20:02:34 +00:00
basic clippy fixes
This commit is contained in:
@@ -617,7 +617,7 @@ fn encode_command(
|
||||
|
||||
// println!("Encode: file_name: {}, barcode_type: {}, width: {:?}, height: {:?}, data: '{:?}', data_file: {:?}", file_name, barcode_type, width, height, data, data_file);
|
||||
|
||||
let writer = MultiFormatWriter::default();
|
||||
let writer = MultiFormatWriter;
|
||||
match writer.encode_with_hints(
|
||||
&input_data,
|
||||
barcode_type,
|
||||
|
||||
@@ -67,7 +67,7 @@ pub fn parse(result: &RXingResult) -> Option<ParsedClientResult> {
|
||||
*/
|
||||
pub fn isBasicallyValidEmailAddress(email: &str, regex: &Regex) -> bool {
|
||||
let email_exists = !email.is_empty();
|
||||
let email_has_at = matches!(email.find('@'), Some(_));
|
||||
let email_has_at = email.find('@').is_some();
|
||||
let email_alphamatcher = if let Some(mtch) = regex.find(email) {
|
||||
mtch.start() == 0 && mtch.end() == email.len()
|
||||
} else {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
mod cpp_new_detector;
|
||||
|
||||
pub(self) use crate::common::cpp_essentials::bitmatrix_cursor_trait::*;
|
||||
use crate::common::cpp_essentials::bitmatrix_cursor_trait::*;
|
||||
|
||||
pub(self) use crate::common::cpp_essentials::dm_regression_line::*;
|
||||
pub(self) use crate::common::cpp_essentials::edge_tracer::*;
|
||||
use crate::common::cpp_essentials::dm_regression_line::*;
|
||||
use crate::common::cpp_essentials::edge_tracer::*;
|
||||
|
||||
pub(self) use crate::common::cpp_essentials::util;
|
||||
use crate::common::cpp_essentials::util;
|
||||
|
||||
pub use cpp_new_detector::detect;
|
||||
|
||||
@@ -60,7 +60,7 @@ pub fn decode_with_hints(
|
||||
let mode = codewords[0] & 0x0F;
|
||||
let mut datawords;
|
||||
match mode {
|
||||
2 | 3 | 4 => {
|
||||
2..=4 => {
|
||||
correctErrors(&mut codewords, 20, 84, 40, EVEN)?;
|
||||
correctErrors(&mut codewords, 20, 84, 40, ODD)?;
|
||||
datawords = vec![0u8; 94];
|
||||
|
||||
@@ -44,10 +44,10 @@ fn testDecodingRowByRow() {
|
||||
|
||||
// let tester = ;
|
||||
|
||||
assert!(|| -> Result<Vec<ExpandedPair>> {
|
||||
assert!({
|
||||
rssExpandedReader.decodeRow2pairs(firstRowNumber as u32, &firstRow)
|
||||
// fail(NotFoundException.class.getName() + " expected");
|
||||
}()
|
||||
}
|
||||
.is_err());
|
||||
|
||||
assert_eq!(1, rssExpandedReader.getRows().len());
|
||||
|
||||
@@ -452,7 +452,7 @@ fn createDecoderRXingResult(
|
||||
}
|
||||
}
|
||||
}
|
||||
let ambiguousIndexValues = Vec::from_iter(ambiguousIndexValuesList.into_iter());
|
||||
let ambiguousIndexValues = Vec::from_iter(ambiguousIndexValuesList);
|
||||
// for value in ambiguousIndexValuesList {
|
||||
// ambiguousIndexValues.push(value);
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user