diff --git a/src/datetime.rs b/src/datetime.rs index 8d4b7cfad..50daa269c 100644 --- a/src/datetime.rs +++ b/src/datetime.rs @@ -66,7 +66,7 @@ use std::marker::PhantomData; use pyo3::{sync::GILProtected, Bound, Py, Python}; use rustc_hash::FxHashMap; -use crate::dtype::{Element, PyArrayDescr, PyArrayDescrMethods, clone_methods_impl}; +use crate::dtype::{clone_methods_impl, Element, PyArrayDescr, PyArrayDescrMethods}; use crate::npyffi::{ PyArray_DatetimeDTypeMetaData, PyDataType_C_METADATA, NPY_DATETIMEUNIT, NPY_TYPES, }; diff --git a/src/dtype.rs b/src/dtype.rs index 31e7cb8c7..abb1d3033 100644 --- a/src/dtype.rs +++ b/src/dtype.rs @@ -5,6 +5,8 @@ use std::ptr; #[cfg(feature = "half")] use half::{bf16, f16}; use num_traits::{Bounded, Zero}; +#[cfg(feature = "half")] +use pyo3::sync::GILOnceCell; use pyo3::{ exceptions::{PyIndexError, PyValueError}, ffi::{self, PyTuple_Size}, @@ -12,8 +14,6 @@ use pyo3::{ types::{PyAnyMethods, PyDict, PyDictMethods, PyTuple, PyType}, Borrowed, Bound, Py, PyAny, PyObject, PyResult, PyTypeInfo, Python, ToPyObject, }; -#[cfg(feature = "half")] -use pyo3::{sync::GILOnceCell}; #[cfg(feature = "gil-refs")] use pyo3::{AsPyPointer, PyNativeType}; @@ -790,14 +790,14 @@ macro_rules! clone_methods_impl { #[inline] fn array_from_view( _py: ::pyo3::Python<'_>, - view: ::ndarray::ArrayView<'_, $Self, D> + view: ::ndarray::ArrayView<'_, $Self, D>, ) -> ::ndarray::Array<$Self, D> where - D: ::ndarray::Dimension + D: ::ndarray::Dimension, { ::ndarray::ArrayView::to_owned(&view) } - } + }; } pub(crate) use clone_methods_impl;