Skip to content

Commit fdc389e

Browse files
committed
Remove Element::is_same_type()
1 parent 5d55c70 commit fdc389e

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

src/dtype.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,6 @@ impl DataType {
259259
/// unsafe impl Element for Wrapper {
260260
/// const DATA_TYPE: DataType = DataType::Object;
261261
///
262-
/// fn is_same_type(dtype: &PyArrayDescr) -> bool {
263-
/// dtype.get_datatype() == Some(DataType::Object)
264-
/// }
265-
///
266262
/// fn get_dtype(py: Python) -> &PyArrayDescr {
267263
/// PyArrayDescr::object(py)
268264
/// }
@@ -280,9 +276,6 @@ pub unsafe trait Element: Clone + Send {
280276
/// `DataType` corresponding to this type.
281277
const DATA_TYPE: DataType;
282278

283-
/// Returns if the give `dtype` is convertible to `Self` in Rust.
284-
fn is_same_type(dtype: &PyArrayDescr) -> bool;
285-
286279
/// Create `dtype`.
287280
fn get_dtype(py: Python) -> &PyArrayDescr;
288281
}
@@ -292,10 +285,6 @@ macro_rules! impl_num_element {
292285
unsafe impl Element for $ty {
293286
const DATA_TYPE: DataType = $data_type;
294287

295-
fn is_same_type(dtype: &PyArrayDescr) -> bool {
296-
dtype.get_datatype() == Some($data_type)
297-
}
298-
299288
fn get_dtype(py: Python) -> &PyArrayDescr {
300289
PyArrayDescr::from_npy_type(py, $data_type.into_npy_type())
301290
}
@@ -328,10 +317,6 @@ cfg_if! {
328317
unsafe impl Element for PyObject {
329318
const DATA_TYPE: DataType = DataType::Object;
330319

331-
fn is_same_type(dtype: &PyArrayDescr) -> bool {
332-
dtype.get_typenum() == NPY_TYPES::NPY_OBJECT as i32
333-
}
334-
335320
fn get_dtype(py: Python) -> &PyArrayDescr {
336321
PyArrayDescr::object(py)
337322
}

0 commit comments

Comments
 (0)