cargo clippy && fmt

This commit is contained in:
Henry Schimke
2023-03-02 15:54:40 -06:00
parent a0b8b68869
commit 9431031147
28 changed files with 111 additions and 135 deletions

View File

@@ -20,7 +20,7 @@ use regex::Regex;
use once_cell::sync::Lazy;
use crate::{RXingResult, common::CharacterSetECI};
use crate::{common::CharacterSetECI, RXingResult};
use uriparse::URI;
@@ -405,9 +405,7 @@ fn maybeAppendFragment(fragmentBuffer: &mut Vec<u8>, charset: &str, result: &mut
fragment = String::from_utf8(fragmentBytes).unwrap_or_else(|_| String::default());
// fragment = new String(fragmentBytes, StandardCharsets.UTF_8);
} else if let Some(enc) = CharacterSetECI::getCharacterSetECIByName(charset) {
fragment = if let Ok(encoded_result) =
enc.decode(&fragmentBytes)
{
fragment = if let Ok(encoded_result) = enc.decode(&fragmentBytes) {
encoded_result
} else {
String::from_utf8(fragmentBytes).unwrap_or_else(|_| String::default())