cargo clippy --fix

This commit is contained in:
Henry Schimke
2023-01-27 15:24:24 -06:00
parent 58e6827e89
commit 42d40de755
86 changed files with 196 additions and 335 deletions

View File

@@ -110,7 +110,7 @@ impl fmt::Display for ByteMatrix {
}
result.push('\n');
}
write!(f, "{}", result)
write!(f, "{result}")
}
}

View File

@@ -186,8 +186,7 @@ pub fn getDataMaskBit(maskPattern: u32, x: u32, y: u32) -> Result<bool, Exceptio
}
_ => {
return Err(Exceptions::IllegalArgumentException(Some(format!(
"Invalid mask pattern: {}",
maskPattern
"Invalid mask pattern: {maskPattern}"
))))
}
};

View File

@@ -161,8 +161,7 @@ impl MinimalEncoder {
&self.ecLevel,
) {
return Err(Exceptions::WriterException(Some(format!(
"Data too big for version {}",
version
"Data too big for version {version}"
))));
}
Ok(result)
@@ -270,8 +269,7 @@ impl MinimalEncoder {
Mode::BYTE => Ok(3),
Mode::KANJI => Ok(0),
_ => Err(Exceptions::IllegalArgumentException(Some(format!(
"Illegal mode {:?}",
mode
"Illegal mode {mode:?}"
)))),
}
// switch (mode) {
@@ -956,7 +954,7 @@ impl fmt::Display for RXingResultList {
result.push_str(&current.to_string());
previous = Some(current);
}
write!(f, "{}", result)
write!(f, "{result}")
}
}
@@ -1141,6 +1139,6 @@ impl fmt::Display for RXingResultNode {
}
result.push(')');
write!(f, "{}", result)
write!(f, "{result}")
}
}

View File

@@ -134,7 +134,7 @@ impl fmt::Display for QRCode {
}
result.push_str(">>\n");
write!(f, "{}", result)
write!(f, "{result}")
}
}

View File

@@ -430,8 +430,7 @@ pub fn terminateBits(num_data_bytes: u32, bits: &mut BitArray) -> Result<(), Exc
let capacity = num_data_bytes * 8;
if bits.getSize() > capacity as usize {
return Err(Exceptions::WriterException(Some(format!(
"data bits cannot fit in the QR Code{} > ",
capacity
"data bits cannot fit in the QR Code{capacity} > "
))));
// throw new WriterException("data bits cannot fit in the QR Code" + bits.getSize() + " > " +
// capacity);
@@ -701,8 +700,7 @@ pub fn appendBytes(
Mode::BYTE => append8BitBytes(content, bits, encoding),
Mode::KANJI => appendKanjiBytes(content, bits),
_ => Err(Exceptions::WriterException(Some(format!(
"Invalid mode: {:?}",
mode
"Invalid mode: {mode:?}"
)))),
}
// switch (mode) {