mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 12:22:34 +00:00
warning cleanup
This commit is contained in:
@@ -155,7 +155,7 @@ pub fn encode_with_hints(
|
||||
let encoding = if encoding.is_some() {
|
||||
encoding.unwrap()
|
||||
} else {
|
||||
if let Ok(encs) = DEFAULT_BYTE_MODE_ENCODING.encode(content, encoding::EncoderTrap::Strict){
|
||||
if let Ok(_encs) = DEFAULT_BYTE_MODE_ENCODING.encode(content, encoding::EncoderTrap::Strict){
|
||||
DEFAULT_BYTE_MODE_ENCODING
|
||||
}else {
|
||||
has_encoding_hint = true;
|
||||
|
||||
@@ -169,7 +169,7 @@ pub fn embedTypeInfo(
|
||||
matrix: &mut ByteMatrix,
|
||||
) -> Result<(), Exceptions> {
|
||||
let mut typeInfoBits = BitArray::new();
|
||||
makeTypeInfoBits(ecLevel, maskPattern as u32, &mut typeInfoBits);
|
||||
makeTypeInfoBits(ecLevel, maskPattern as u32, &mut typeInfoBits)?;
|
||||
|
||||
for i in 0..typeInfoBits.getSize() {
|
||||
// for (int i = 0; i < typeInfoBits.getSize(); ++i) {
|
||||
@@ -363,7 +363,7 @@ pub fn makeTypeInfoBits(
|
||||
|
||||
let mut maskBits = BitArray::new();
|
||||
maskBits.appendBits(TYPE_INFO_MASK_PATTERN, 15)?;
|
||||
bits.xor(&maskBits);
|
||||
bits.xor(&maskBits)?;
|
||||
|
||||
if bits.getSize() != 15 {
|
||||
// Just in case.
|
||||
|
||||
@@ -943,7 +943,7 @@ impl RXingResultList {
|
||||
*/
|
||||
pub fn getBits(&self, bits: &mut BitArray) -> Result<(), Exceptions> {
|
||||
for resultNode in &self.list {
|
||||
resultNode.getBits(bits);
|
||||
resultNode.getBits(bits)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -1078,19 +1078,19 @@ impl RXingResultNode {
|
||||
* appends the bits
|
||||
*/
|
||||
fn getBits(&self, bits: &mut BitArray) -> Result<(), Exceptions> {
|
||||
bits.appendBits(self.mode.getBits() as u32, 4);
|
||||
bits.appendBits(self.mode.getBits() as u32, 4)?;
|
||||
if self.characterLength > 0 {
|
||||
let length = self.getCharacterCountIndicator();
|
||||
bits.appendBits(
|
||||
length,
|
||||
self.mode.getCharacterCountBits(self.version) as usize,
|
||||
);
|
||||
)?;
|
||||
}
|
||||
if self.mode == Mode::ECI {
|
||||
bits.appendBits(
|
||||
self.encoders.getECIValue(self.charsetEncoderIndex as usize),
|
||||
8,
|
||||
);
|
||||
)?;
|
||||
} else if self.characterLength > 0 {
|
||||
// append data
|
||||
encoder::appendBytes(
|
||||
@@ -1100,7 +1100,7 @@ impl RXingResultNode {
|
||||
self.mode,
|
||||
bits,
|
||||
self.encoders.getCharset(self.charsetEncoderIndex as usize),
|
||||
);
|
||||
)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user