Skip to content

Commit

Permalink
more relevant message when casting to array
Browse files Browse the repository at this point in the history
  • Loading branch information
radumarias committed Jun 10, 2024
1 parent a07f050 commit 82dccd3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "zeroize"
version = "0.4.21"
version = "0.4.22"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn as_array_mut<'a>(arr: &'a Bound<PyAny>) -> PyResult<&'a mut [u8]> {
arr.as_slice_mut().unwrap()
} else {
return Err(PyErr::new::<pyo3::exceptions::PyTypeError, _>(
"Expected a PyByteArray or PyArray1<u8>",
"Expected a bytearray or numpy.array",
));
}
};
Expand All @@ -72,7 +72,7 @@ fn as_array<'a>(arr: &'a Bound<PyAny>) -> PyResult<&'a [u8]> {
arr.as_slice().unwrap()
} else {
return Err(PyErr::new::<pyo3::exceptions::PyTypeError, _>(
"Expected a PyByteArray or PyArray1<u8>",
"Expected a bytearray, bytes or numpy.array",
));
}
};
Expand Down

0 comments on commit 82dccd3

Please sign in to comment.