mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-27 21:02:35 +00:00
Implement clippy suggestions
This commit is contained in:
@@ -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' => {
|
||||
|
||||
Reference in New Issue
Block a user