Skip to content

Commit c5741fa

Browse files
committed
Minor improvement of internal error message
This error path shouldn't ever be hit if the driver is working as intended. This change might make debugging while developing the driver slightly easier in the future. Initial discussion: #70 (comment)
1 parent a1904d3 commit c5741fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vector.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ fn swap_endian<'py>(
3838
let bytes = &data.as_bytes();
3939
let len = bytes.len();
4040
if len % type_size != 0 {
41-
return Err(PyErr::new::<PyValueError, _>(
42-
"Data length not a multiple of type_size",
43-
));
41+
return Err(PyErr::new::<PyValueError, _>(format!(
42+
"Data length {len} not a multiple of type_size {type_size}",
43+
)));
4444
}
4545

4646
PyBytes::new_with(py, bytes.len(), |out| {

0 commit comments

Comments
 (0)