mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 12:22:34 +00:00
cargo clippy && fmt
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
* This file has been modified from its original form in Barcode4J.
|
||||
*/
|
||||
|
||||
use crate::common::{Result, CharacterSetECI};
|
||||
use crate::common::{CharacterSetECI, Result};
|
||||
use crate::Exceptions;
|
||||
|
||||
use super::{
|
||||
|
||||
@@ -197,16 +197,17 @@ pub fn encodeHighLevel(
|
||||
input = Box::new(NoECIInput::new(msg.to_owned()));
|
||||
if encoding.is_none() {
|
||||
encoding = Some(DEFAULT_ENCODING);
|
||||
} else if &DEFAULT_ENCODING
|
||||
!= encoding.as_ref().ok_or(Exceptions::ILLEGAL_STATE)?
|
||||
{
|
||||
} else if &DEFAULT_ENCODING != encoding.as_ref().ok_or(Exceptions::ILLEGAL_STATE)? {
|
||||
// if let Some(eci) =
|
||||
// CharacterSetECI::getCharacterSetECI(encoding.ok_or(Exceptions::ILLEGAL_STATE)?)
|
||||
// {
|
||||
// encodingECI(CharacterSetECI::getValue(&eci) as i32, &mut sb)?;
|
||||
// }
|
||||
|
||||
encodingECI(CharacterSetECI::getValue(&encoding.ok_or(Exceptions::ILLEGAL_STATE)?) as i32, &mut sb)?;
|
||||
encodingECI(
|
||||
CharacterSetECI::getValue(&encoding.ok_or(Exceptions::ILLEGAL_STATE)?) as i32,
|
||||
&mut sb,
|
||||
)?;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -778,12 +779,7 @@ fn determineConsecutiveBinaryCount<T: ECIInput + ?Sized + 'static>(
|
||||
}
|
||||
|
||||
if let Some(encoder) = encoding {
|
||||
let can_encode = encoder
|
||||
.encode(
|
||||
&input.charAt(idx)?.to_string()
|
||||
|
||||
)
|
||||
.is_ok();
|
||||
let can_encode = encoder.encode(&input.charAt(idx)?.to_string()).is_ok();
|
||||
|
||||
if !can_encode {
|
||||
if TypeId::of::<T>() != TypeId::of::<NoECIInput>() {
|
||||
@@ -866,7 +862,10 @@ impl Display for NoECIInput {
|
||||
*/
|
||||
#[cfg(test)]
|
||||
mod PDF417EncoderTestCase {
|
||||
use crate::{pdf417::encoder::{pdf_417_high_level_encoder::encodeHighLevel, Compaction}, common::CharacterSetECI};
|
||||
use crate::{
|
||||
common::CharacterSetECI,
|
||||
pdf417::encoder::{pdf_417_high_level_encoder::encodeHighLevel, Compaction},
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn testEncodeAuto() {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use crate::common::{Result, CharacterSetECI};
|
||||
use crate::common::{CharacterSetECI, Result};
|
||||
|
||||
use super::{pdf_417_high_level_encoder, Compaction};
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::{
|
||||
common::{BitMatrix, Result, CharacterSetECI},
|
||||
common::{BitMatrix, CharacterSetECI, Result},
|
||||
BarcodeFormat, EncodeHintType, EncodeHintValue, Exceptions, Writer,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user