clippy --fix && fmt

This commit is contained in:
Henry Schimke
2023-03-04 14:17:56 -06:00
parent 8a0744e534
commit 69c0119c94
11 changed files with 64 additions and 68 deletions

View File

@@ -15,7 +15,7 @@
*/
use crate::{
common::{BitSource, CharacterSet, DecoderRXingResult, Result, StringUtils, Eci},
common::{BitSource, CharacterSet, DecoderRXingResult, Eci, Result, StringUtils},
DecodingHintDictionary, Exceptions,
};
@@ -91,7 +91,7 @@ pub fn decode(
Mode::ECI => {
// Count doesn't apply to ECI
let value = parseECIValue(&mut bits)?;
currentCharacterSetECI = CharacterSet::from(Eci::from(value)).into();//CharacterSet::get_character_set_by_eci(value).ok();
currentCharacterSetECI = CharacterSet::from(Eci::from(value)).into(); //CharacterSet::get_character_set_by_eci(value).ok();
if currentCharacterSetECI.is_none() {
return Err(Exceptions::format_with(format!(
"Value of {value} not valid"

View File

@@ -24,7 +24,7 @@ use unicode_segmentation::UnicodeSegmentation;
use crate::{
common::{
reedsolomon::{get_predefined_genericgf, PredefinedGenericGF, ReedSolomonEncoder},
BitArray, CharacterSet, Result, Eci,
BitArray, CharacterSet, Eci, Result,
},
qrcode::decoder::{ErrorCorrectionLevel, Mode, Version, VersionRef},
EncodeHintType, EncodeHintValue, EncodingHintDictionary, Exceptions,
@@ -716,11 +716,7 @@ pub fn appendAlphanumericBytes(content: &str, bits: &mut BitArray) -> Result<()>
Ok(())
}
pub fn append8BitBytes(
content: &str,
bits: &mut BitArray,
encoding: CharacterSet,
) -> Result<()> {
pub fn append8BitBytes(content: &str, bits: &mut BitArray, encoding: CharacterSet) -> Result<()> {
let bytes = encoding
.encode(content)
.map_err(|e| Exceptions::writer_with(format!("error {e}")))?;