basic clippy fixes

This commit is contained in:
Henry Schimke
2023-10-28 10:57:42 -05:00
parent 88a4083799
commit 4c9ec95d00
6 changed files with 10 additions and 10 deletions

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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];

View File

@@ -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());

View File

@@ -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);
// }