mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 12:22:34 +00:00
remove .to_owned() calls on &str in exceptions
This commit is contained in:
@@ -188,13 +188,13 @@ pub fn encode_bytes_with_charset(
|
||||
stuffed_bits = stuffBits(&bits, word_size as usize)?;
|
||||
if stuffed_bits.getSize() as u32 + ecc_bits > usable_bits_in_layers {
|
||||
return Err(Exceptions::illegalArgument(
|
||||
"Data to large for user specified layer".to_owned(),
|
||||
"Data to large for user specified layer",
|
||||
));
|
||||
}
|
||||
if compact && stuffed_bits.getSize() as u32 > word_size * 64 {
|
||||
// Compact format only allows 64 data words, though C4 can hold more words than that
|
||||
return Err(Exceptions::illegalArgument(
|
||||
"Data to large for user specified layer".to_owned(),
|
||||
"Data to large for user specified layer",
|
||||
));
|
||||
}
|
||||
} else {
|
||||
@@ -208,7 +208,7 @@ pub fn encode_bytes_with_charset(
|
||||
// for (int i = 0; ; i++) {
|
||||
if i > MAX_NB_BITS {
|
||||
return Err(Exceptions::illegalArgument(
|
||||
"Data too large for an Aztec code".to_owned(),
|
||||
"Data too large for an Aztec code",
|
||||
));
|
||||
}
|
||||
compact = i <= 3;
|
||||
|
||||
@@ -248,9 +248,7 @@ impl HighLevelEncoder {
|
||||
initial_state = initial_state.appendFLGn(CharacterSetECI::getValue(&eci))?;
|
||||
}
|
||||
} else {
|
||||
return Err(Exceptions::illegalArgument(
|
||||
"No ECI code for character set".to_owned(),
|
||||
));
|
||||
return Err(Exceptions::illegalArgument("No ECI code for character set"));
|
||||
}
|
||||
// if self.charset != null {
|
||||
// CharacterSetECI eci = CharacterSetECI.getCharacterSetECI(charset);
|
||||
|
||||
@@ -81,7 +81,7 @@ impl State {
|
||||
} else */
|
||||
if eci > 999999 {
|
||||
return Err(Exceptions::illegalArgument(
|
||||
"ECI code must be between 0 and 999999".to_owned(),
|
||||
"ECI code must be between 0 and 999999",
|
||||
));
|
||||
// throw new IllegalArgumentException("ECI code must be between 0 and 999999");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user