Skip to content

Commit

Permalink
Only fail on numpy import if using numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger committed May 16, 2021
1 parent a15fda8 commit 7f78776
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ pub enum BytesType<'a> {
/// `bytearray`
#[pyo3(transparent, annotation = "bytearray")]
ByteArray(RustyPyByteArray<'a>),
/// `numpy.array` with `dtype=np.uint8`
#[pyo3(transparent, annotation = "numpy")]
NumpyArray(RustyNumpyArray<'a>),
/// [`cramjam.File`](io/struct.RustyFile.html)
#[pyo3(transparent, annotation = "File")]
RustyFile(&'a PyCell<RustyFile>),
/// [`cramjam.Buffer`](io/struct.RustyBuffer.html)
#[pyo3(transparent, annotation = "Buffer")]
RustyBuffer(&'a PyCell<RustyBuffer>),
/// `numpy.array` with `dtype=np.uint8`
#[pyo3(transparent, annotation = "numpy")]
NumpyArray(RustyNumpyArray<'a>)
}

impl<'a> AsBytes for BytesType<'a> {
Expand Down

0 comments on commit 7f78776

Please sign in to comment.