Skip to content

Commit

Permalink
workaround msrv lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Jul 3, 2023
1 parent 5fb41a4 commit 7b2d627
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pyo3-ffi/src/cpython/unicodeobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,22 +262,19 @@ pub struct PyASCIIObject {

/// Interacting with the bitfield is not actually well-defined, so we mark these APIs unsafe.
impl PyASCIIObject {
#[cfg_attr(not(Py_3_12), allow(rustdoc::broken_intra_doc_links))] // SSTATE_INTERNED_IMMORTAL_STATIC requires 3.12
/// Get the `interned` field of the [`PyASCIIObject`] state bitfield.
///
/// Returns one of: [`SSTATE_NOT_INTERNED`], [`SSTATE_INTERNED_MORTAL`],
/// [`SSTATE_INTERNED_IMMORTAL`], or [`SSTATE_INTERNED_IMMORTAL_STATIC`].
/// or [`SSTATE_INTERNED_IMMORTAL`].
#[inline]
pub unsafe fn interned(&self) -> c_uint {
PyASCIIObjectState::from(self.state).interned()
}

#[cfg_attr(not(Py_3_12), allow(rustdoc::broken_intra_doc_links))] // SSTATE_INTERNED_IMMORTAL_STATIC requires 3.12
/// Set the `interned` field of the [`PyASCIIObject`] state bitfield.
///
/// Calling this function with an argument that is not [`SSTATE_NOT_INTERNED`],
/// [`SSTATE_INTERNED_MORTAL`], [`SSTATE_INTERNED_IMMORTAL`], or
/// [`SSTATE_INTERNED_IMMORTAL_STATIC`] is invalid.
/// [`SSTATE_INTERNED_MORTAL`], or [`SSTATE_INTERNED_IMMORTAL`] is invalid.
#[inline]
pub unsafe fn set_interned(&mut self, val: c_uint) {
let mut state = PyASCIIObjectState::from(self.state);
Expand Down

0 comments on commit 7b2d627

Please sign in to comment.