mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
Update macro and cargo fmt
This commit is contained in:
@@ -79,7 +79,8 @@ impl Encoder for Base256Encoder {
|
||||
.ok_or(Exceptions::INDEX_OUT_OF_BOUNDS)?;
|
||||
buffer.insert(
|
||||
ci_pos,
|
||||
char::from_u32(dataCount as u32 % 250).ok_or(Exceptions::INDEX_OUT_OF_BOUNDS)?,
|
||||
char::from_u32(dataCount as u32 % 250)
|
||||
.ok_or(Exceptions::INDEX_OUT_OF_BOUNDS)?,
|
||||
);
|
||||
} else {
|
||||
return Err(Exceptions::illegal_state_with(format!(
|
||||
@@ -92,7 +93,10 @@ impl Encoder for Base256Encoder {
|
||||
// for (int i = 0, c = buffer.length(); i < c; i++) {
|
||||
context.writeCodeword(
|
||||
Self::randomize255State(
|
||||
buffer.chars().nth(i).ok_or(Exceptions::INDEX_OUT_OF_BOUNDS)?,
|
||||
buffer
|
||||
.chars()
|
||||
.nth(i)
|
||||
.ok_or(Exceptions::INDEX_OUT_OF_BOUNDS)?,
|
||||
context.getCodewordCount() as u32 + 1,
|
||||
)
|
||||
.ok_or(Exceptions::PARSE)? as u8,
|
||||
|
||||
@@ -183,9 +183,7 @@ impl C40Encoder {
|
||||
context: &mut EncoderContext,
|
||||
buffer: &mut String,
|
||||
) -> Result<()> {
|
||||
context.writeCodewords(
|
||||
&Self::encodeToCodewords(buffer).ok_or(Exceptions::FORMAT)?,
|
||||
);
|
||||
context.writeCodewords(&Self::encodeToCodewords(buffer).ok_or(Exceptions::FORMAT)?);
|
||||
buffer.replace_range(0..3, "");
|
||||
// buffer.delete(0, 3);
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user