@@ -258,7 +258,7 @@ impl PyUntypedArray {
258258
259259/// Implementation of functionality for [`PyUntypedArray`].
260260#[ doc( alias = "PyUntypedArray" ) ]
261- pub trait PyUntypedArrayMethods < ' py > : sealed :: Sealed {
261+ pub trait PyUntypedArrayMethods < ' py > : Sealed {
262262 /// Returns a raw pointer to the underlying [`PyArrayObject`][npyffi::PyArrayObject].
263263 fn as_array_ptr ( & self ) -> * mut npyffi:: PyArrayObject ;
264264
@@ -423,6 +423,12 @@ pub trait PyUntypedArrayMethods<'py>: sealed::Sealed {
423423 }
424424}
425425
426+ mod sealed {
427+ pub trait Sealed { }
428+ }
429+
430+ use sealed:: Sealed ;
431+
426432fn check_flags ( obj : & npyffi:: PyArrayObject , flags : i32 ) -> bool {
427433 obj. flags & flags != 0
428434}
@@ -441,6 +447,8 @@ impl<'py> PyUntypedArrayMethods<'py> for Bound<'py, PyUntypedArray> {
441447 }
442448}
443449
450+ impl Sealed for Bound < ' _ , PyUntypedArray > { }
451+
444452// We won't be able to provide a `Deref` impl from `Bound<'_, PyArray<T, D>>` to
445453// `Bound<'_, PyUntypedArray>`, so this seems to be the next best thing to do
446454impl < ' py , T , D > PyUntypedArrayMethods < ' py > for Bound < ' py , PyArray < T , D > > {
@@ -455,11 +463,4 @@ impl<'py, T, D> PyUntypedArrayMethods<'py> for Bound<'py, PyArray<T, D>> {
455463 }
456464}
457465
458- mod sealed {
459- use super :: { PyArray , PyUntypedArray } ;
460-
461- pub trait Sealed { }
462-
463- impl Sealed for pyo3:: Bound < ' _ , PyUntypedArray > { }
464- impl < T , D > Sealed for pyo3:: Bound < ' _ , PyArray < T , D > > { }
465- }
466+ impl < T , D > Sealed for Bound < ' _ , PyArray < T , D > > { }
0 commit comments