Update macro and cargo fmt

This commit is contained in:
Steve Cook
2023-03-01 13:43:21 -05:00
parent 51fcc98b34
commit b561bd77c3
19 changed files with 101 additions and 64 deletions

View File

@@ -152,7 +152,9 @@ impl BitMatrix {
first_run = false;
rowLength = bitsPos - rowStartPos;
} else if bitsPos - rowStartPos != rowLength {
return Err(Exceptions::illegal_argument_with("row lengths do not match"));
return Err(Exceptions::illegal_argument_with(
"row lengths do not match",
));
}
rowStartPos = bitsPos;
nRows += 1;
@@ -181,7 +183,9 @@ impl BitMatrix {
// first_run = false;
rowLength = bitsPos - rowStartPos;
} else if bitsPos - rowStartPos != rowLength {
return Err(Exceptions::illegal_argument_with("row lengths do not match"));
return Err(Exceptions::illegal_argument_with(
"row lengths do not match",
));
}
nRows += 1;
}

View File

@@ -74,7 +74,9 @@ impl ReedSolomonEncoder {
pub fn encode(&mut self, to_encode: &mut Vec<i32>, ec_bytes: usize) -> Result<()> {
if ec_bytes == 0 {
return Err(Exceptions::illegal_argument_with("No error correction bytes"));
return Err(Exceptions::illegal_argument_with(
"No error correction bytes",
));
}
let data_bytes = to_encode.len() - ec_bytes;
if data_bytes == 0 {