remove .to_owned() calls on &str in exceptions

This commit is contained in:
Vukašin Stepanović
2023-02-15 11:03:27 +00:00
parent 722ce78fd0
commit 528ddea41c
47 changed files with 107 additions and 167 deletions

View File

@@ -254,7 +254,7 @@ impl BitArray {
pub fn appendBits(&mut self, value: u32, num_bits: usize) -> Result<(), Exceptions> {
if num_bits > 32 {
return Err(Exceptions::illegalArgument(
"num bits must be between 0 and 32".to_owned(),
"num bits must be between 0 and 32",
));
}
@@ -286,7 +286,7 @@ impl BitArray {
pub fn xor(&mut self, other: &BitArray) -> Result<(), Exceptions> {
if self.size != other.size {
return Err(Exceptions::illegalArgument("Sizes don't match".to_owned()));
return Err(Exceptions::illegalArgument("Sizes don't match"));
}
for i in 0..self.bits.len() {
//for (int i = 0; i < bits.length; i++) {