From 81c5bdfdf3a81d0fe5758caf45a0904e5d53d4f9 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 26 Oct 2024 12:35:02 -0400 Subject: [PATCH] Update comments now that a std API is stable, but too high MSRV (#4658) --- src/buffer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/buffer.rs b/src/buffer.rs index 85144f6ff99..2d94681a5c7 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -191,14 +191,14 @@ impl FromPyObject<'_> for PyBuffer { impl PyBuffer { /// Gets the underlying buffer from the specified python object. pub fn get(obj: &Bound<'_, PyAny>) -> PyResult> { - // TODO: use nightly API Box::new_uninit() once stable + // TODO: use nightly API Box::new_uninit() once our MSRV is 1.82 let mut buf = Box::new(mem::MaybeUninit::uninit()); let buf: Box = { err::error_on_minusone(obj.py(), unsafe { ffi::PyObject_GetBuffer(obj.as_ptr(), buf.as_mut_ptr(), ffi::PyBUF_FULL_RO) })?; // Safety: buf is initialized by PyObject_GetBuffer. - // TODO: use nightly API Box::assume_init() once stable + // TODO: use nightly API Box::assume_init() once our MSRV is 1.82 unsafe { mem::transmute(buf) } }; // Create PyBuffer immediately so that if validation checks fail, the PyBuffer::drop code