Skip to content

Commit 6d25071

Browse files
JRRudy1davidhewitt
authored andcommitted
Minor tweaks to please the lint gods.
1 parent f4dd5d4 commit 6d25071

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ impl<T, D> PyArray<T, D> {
239239
///
240240
/// This is a wrapper around [`pyo3::FromPyPointer::from_owned_ptr_or_opt`] and inherits its safety contract.
241241
pub unsafe fn from_owned_ptr<'py>(py: Python<'py>, ptr: *mut ffi::PyObject) -> &'py Self {
242-
#[allow(deprecated)]
242+
#![allow(deprecated)]
243243
py.from_owned_ptr(ptr)
244244
}
245245

@@ -249,7 +249,7 @@ impl<T, D> PyArray<T, D> {
249249
///
250250
/// This is a wrapper around [`pyo3::FromPyPointer::from_borrowed_ptr_or_opt`] and inherits its safety contract.
251251
pub unsafe fn from_borrowed_ptr<'py>(py: Python<'py>, ptr: *mut ffi::PyObject) -> &'py Self {
252-
#[allow(deprecated)]
252+
#![allow(deprecated)]
253253
py.from_borrowed_ptr(ptr)
254254
}
255255

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ as well as the [`PyReadonlyArray::try_as_matrix`] and [`PyReadwriteArray::try_as
6565
//! Matrix3::new(30, 36, 42, 66, 81, 96, 102, 126, 150)
6666
//! );
6767
//! });
68-
//! ```
68+
#![doc = "```"]
6969
//!
7070
//! [c-api]: https://numpy.org/doc/stable/reference/c-api
7171
//! [ndarray]: https://numpy.org/doc/stable/reference/arrays.ndarray.html

tests/array.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ use ndarray::{array, s, Array1, Dim};
66
use numpy::prelude::*;
77
use numpy::{
88
dtype_bound, get_array_module, npyffi::NPY_ORDER, pyarray_bound, PyArray, PyArray1, PyArray2,
9-
PyArrayDescr, PyArrayDyn, PyFixedString, PyFixedUnicode,
9+
PyArrayDescr, PyFixedString, PyFixedUnicode,
1010
};
1111
use pyo3::{
1212
py_run, pyclass, pymethods,
1313
types::{IntoPyDict, PyAnyMethods, PyDict, PyList},
14-
Bound, Py, PyResult, Python,
14+
Bound, Py, Python,
1515
};
16+
#[cfg(feature = "gil-refs")]
17+
use {numpy::PyArrayDyn, pyo3::PyResult};
1618

1719
fn get_np_locals(py: Python<'_>) -> Bound<'_, PyDict> {
1820
[("np", get_array_module(py).unwrap())].into_py_dict_bound(py)

0 commit comments

Comments
 (0)