Implement clippy suggestions

This commit is contained in:
Henry Schimke
2023-01-04 14:48:16 -06:00
parent c65eadf102
commit 48287631dd
196 changed files with 2465 additions and 2574 deletions

View File

@@ -25,7 +25,7 @@ use rxing_one_d_proc_derive::{EANReader, OneDReader};
*
* @author Sean Owen
*/
#[derive(OneDReader, EANReader)]
#[derive(OneDReader, EANReader, Default)]
pub struct UPCEReader;
impl UPCEANReader for UPCEReader {
@@ -84,12 +84,6 @@ impl UPCEANReader for UPCEReader {
}
}
impl Default for UPCEReader {
fn default() -> Self {
Self {}
}
}
impl UPCEReader {
/**
* The pattern that marks the middle, and end, of a UPC-E pattern.
@@ -146,7 +140,7 @@ impl UPCEReader {
}
}
}
return Err(Exceptions::NotFoundException("".to_owned()));
Err(Exceptions::NotFoundException(None))
}
}
@@ -160,7 +154,7 @@ pub fn convertUPCEtoUPCA(upce: &str) -> String {
let upceChars = &upce[1..7]; //['0';6];//new char[6];
//upce.getChars(1, 7, upceChars, 0);
let mut result = String::with_capacity(12); //new StringBuilder(12);
result.push(upce.chars().nth(0).unwrap());
result.push(upce.chars().next().unwrap());
let lastChar = upceChars.chars().nth(5).unwrap();
match lastChar {
'0' | '1' | '2' => {