Skip to content

Commit 82dccd3

Browse files
committed
more relevant message when casting to array
1 parent a07f050 commit 82dccd3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "zeroize"
3-
version = "0.4.21"
3+
version = "0.4.22"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn as_array_mut<'a>(arr: &'a Bound<PyAny>) -> PyResult<&'a mut [u8]> {
5454
arr.as_slice_mut().unwrap()
5555
} else {
5656
return Err(PyErr::new::<pyo3::exceptions::PyTypeError, _>(
57-
"Expected a PyByteArray or PyArray1<u8>",
57+
"Expected a bytearray or numpy.array",
5858
));
5959
}
6060
};
@@ -72,7 +72,7 @@ fn as_array<'a>(arr: &'a Bound<PyAny>) -> PyResult<&'a [u8]> {
7272
arr.as_slice().unwrap()
7373
} else {
7474
return Err(PyErr::new::<pyo3::exceptions::PyTypeError, _>(
75-
"Expected a PyByteArray or PyArray1<u8>",
75+
"Expected a bytearray, bytes or numpy.array",
7676
));
7777
}
7878
};

0 commit comments

Comments
 (0)