Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/buffer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![cfg(not(Py_LIMITED_API))]
#![cfg_attr(docsrs, doc(cfg(not(Py_LIMITED_API))))]
// Copyright (c) 2017 Daniel Grunwald
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
Expand Down
2 changes: 0 additions & 2 deletions src/class/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ mod macros;

pub mod basic;
#[cfg(not(Py_LIMITED_API))]
#[cfg_attr(docsrs, doc(cfg(not(Py_LIMITED_API))))]
pub mod buffer;
pub mod context;
pub mod descr;
Expand All @@ -24,7 +23,6 @@ pub mod sequence;

pub use self::basic::PyObjectProtocol;
#[cfg(not(Py_LIMITED_API))]
#[cfg_attr(docsrs, doc(cfg(not(Py_LIMITED_API))))]
pub use self::buffer::PyBufferProtocol;
pub use self::context::PyContextProtocol;
pub use self::descr::PyDescrProtocol;
Expand Down
2 changes: 1 addition & 1 deletion src/conversions/eyre.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg(feature = "eyre")]
#![cfg_attr(docsrs, doc(cfg(feature = "eyre")))]

//! A conversion from [eyre]’s [`Report`] type to [`PyErr`].
//!
//! Use of an error handling library like [eyre] is common in application code and when you just
Expand Down
1 change: 0 additions & 1 deletion src/conversions/hashbrown.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![cfg(feature = "hashbrown")]
#![cfg_attr(docsrs, doc(cfg(feature = "hashbrown")))]

//! Conversions to and from [hashbrown](https://docs.rs/hashbrown/)’s
//! `HashMap` and `HashSet`.
Expand Down
1 change: 0 additions & 1 deletion src/conversions/indexmap.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![cfg(feature = "indexmap")]
#![cfg_attr(docsrs, doc(cfg(feature = "indexmap")))]

//! Conversions to and from [indexmap](https://docs.rs/indexmap/)’s
//! `IndexMap`.
Expand Down
5 changes: 0 additions & 5 deletions src/conversions/num_bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
// based on Daniel Grunwald's https://github.com/dgrunwald/rust-cpython

#![cfg(all(feature = "num-bigint", not(any(Py_LIMITED_API, PyPy))))]
#![cfg_attr(
docsrs,
doc(cfg(all(feature = "num-bigint", not(any(Py_LIMITED_API, PyPy)))))
)]

//! Conversions to and from [num-bigint](https://docs.rs/num-bigint)’s [`BigInt`] and [`BigUint`] types.
//!
//! This is useful for converting Python integers when they may not fit in Rust's built-in integer types.
Expand Down
2 changes: 1 addition & 1 deletion src/conversions/num_complex.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg(feature = "num-complex")]
#![cfg_attr(docsrs, doc(cfg(feature = "num-complex")))]

//! Conversions to and from [num-complex](https://docs.rs/num-complex)’
//! [`Complex`]`<`[`f32`]`>` and [`Complex`]`<`[`f64`]`>`.
//!
Expand Down
1 change: 0 additions & 1 deletion src/conversions/serde.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(docsrs, doc(cfg(feature = "serde")))]
#![cfg(feature = "serde")]

//! Enables (de)serialization of [`Py`]`<T>` objects via [serde](https://docs.rs/serde).
Expand Down
1 change: 0 additions & 1 deletion src/ffi/abstract_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ extern "C" {
#[cfg_attr(PyPy, link_name = "PyPyIter_Next")]
pub fn PyIter_Next(arg1: *mut PyObject) -> *mut PyObject;
#[cfg(all(not(PyPy), Py_3_10))]
#[cfg_attr(docsrs, doc(cfg(all(not(PyPy), Py_3_10))))]
pub fn PyIter_Send(iter: *mut PyObject, arg: *mut PyObject, presult: *mut *mut PyObject);

#[cfg_attr(PyPy, link_name = "PyPyNumber_Check")]
Expand Down
6 changes: 0 additions & 6 deletions src/ffi/cpython/pystate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,14 @@ extern "C" {
// skipped _PyThread_CurrentExceptions

#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyInterpreterState_Main() -> *mut PyInterpreterState;
#[cfg_attr(PyPy, link_name = "PyPyInterpreterState_Head")]
pub fn PyInterpreterState_Head() -> *mut PyInterpreterState;
#[cfg_attr(PyPy, link_name = "PyPyInterpreterState_Next")]
pub fn PyInterpreterState_Next(interp: *mut PyInterpreterState) -> *mut PyInterpreterState;
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyInterpreterState_ThreadHead(interp: *mut PyInterpreterState) -> *mut PyThreadState;
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyThreadState_Next(tstate: *mut PyThreadState) -> *mut PyThreadState;

#[cfg(py_sys_config = "WITH_THREAD")]
Expand All @@ -62,7 +59,6 @@ extern "C" {
}

#[cfg(Py_3_9)]
#[cfg_attr(docsrs, doc(cfg(Py_3_9)))]
pub type _PyFrameEvalFunction = extern "C" fn(
*mut crate::ffi::PyThreadState,
*mut crate::ffi::PyFrameObject,
Expand All @@ -72,13 +68,11 @@ pub type _PyFrameEvalFunction = extern "C" fn(
#[cfg(Py_3_9)]
extern "C" {
/// Get the frame evaluation function.
#[cfg_attr(docsrs, doc(cfg(Py_3_9)))]
pub fn _PyInterpreterState_GetEvalFrameFunc(
interp: *mut PyInterpreterState,
) -> _PyFrameEvalFunction;

///Set the frame evaluation function.
#[cfg_attr(docsrs, doc(cfg(Py_3_9)))]
pub fn _PyInterpreterState_SetEvalFrameFunc(
interp: *mut PyInterpreterState,
eval_frame: _PyFrameEvalFunction,
Expand Down
2 changes: 0 additions & 2 deletions src/ffi/cpython/unicodeobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ extern "C" {
// skipped _PyUnicode_Copy

#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyUnicode_CopyCharacters(
to: *mut PyObject,
to_start: Py_ssize_t,
Expand All @@ -264,7 +263,6 @@ extern "C" {
// skipped _PyUnicode_FastCopyCharacters

#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyUnicode_Fill(
unicode: *mut PyObject,
start: Py_ssize_t,
Expand Down
1 change: 0 additions & 1 deletion src/ffi/modsupport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ extern "C" {
// skipped non-limited _PyArg_Fini

#[cfg(Py_3_10)]
#[cfg_attr(docsrs, doc(cfg(Py_3_10)))]
pub fn PyModule_AddObjectRef(
module: *mut PyObject,
name: *const c_char,
Expand Down
4 changes: 0 additions & 4 deletions src/ffi/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,9 @@ extern "C" {
pub const Py_PRINT_RAW: c_int = 1; // No string quotes etc.

#[cfg(Py_3_10)]
#[cfg_attr(docsrs, doc(cfg(Py_3_10)))]
pub const Py_TPFLAGS_DISALLOW_INSTANTIATION: c_ulong = 1 << 7;

#[cfg(Py_3_10)]
#[cfg_attr(docsrs, doc(cfg(Py_3_10)))]
pub const Py_TPFLAGS_IMMUTABLETYPE: c_ulong = 1 << 8;

/// Set if the type object is dynamically allocated
Expand Down Expand Up @@ -468,10 +466,8 @@ extern "C" {
pub fn Py_DecRef(o: *mut PyObject);

#[cfg(Py_3_10)]
#[cfg_attr(docsrs, doc(cfg(Py_3_10)))]
pub fn Py_NewRef(obj: *mut PyObject) -> *mut PyObject;
#[cfg(Py_3_10)]
#[cfg_attr(docsrs, doc(cfg(Py_3_10)))]
pub fn Py_XNewRef(obj: *mut PyObject) -> *mut PyObject;
}

Expand Down
5 changes: 2 additions & 3 deletions src/ffi/objimpl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ extern "C" {
pub fn PyGC_Collect() -> Py_ssize_t;

#[cfg(Py_3_10)]
#[cfg_attr(docsrs, doc(cfg(Py_3_10)))]
pub fn PyGC_Enable() -> c_int;
#[cfg_attr(docsrs, doc(cfg(Py_3_10)))]

pub fn PyGC_Disable() -> c_int;
#[cfg_attr(docsrs, doc(cfg(Py_3_10)))]

pub fn PyGC_IsEnabled() -> c_int;
Comment on lines 33 to 39
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidhewitt Are these supposed to have a #[cfg(Py_3_10)]?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes my bad, good catch!

}

Expand Down
1 change: 0 additions & 1 deletion src/ffi/pyerrors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ extern "C" {
#[cfg_attr(PyPy, link_name = "PyPyErr_SetInterrupt")]
pub fn PyErr_SetInterrupt();
#[cfg(Py_3_10)]
#[cfg_attr(docsrs, doc(cfg(Py_3_10)))]
pub fn PyErr_SetInterruptEx(signum: c_int);
pub fn PyErr_SyntaxLocation(filename: *const c_char, lineno: c_int);
pub fn PyErr_SyntaxLocationEx(filename: *const c_char, lineno: c_int, col_offset: c_int);
Expand Down
11 changes: 0 additions & 11 deletions src/ffi/pystate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,28 @@ opaque_struct!(PyInterpreterState);

extern "C" {
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyInterpreterState_New() -> *mut PyInterpreterState;
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyInterpreterState_Clear(arg1: *mut PyInterpreterState);
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyInterpreterState_Delete(arg1: *mut PyInterpreterState);

#[cfg(all(Py_3_9, not(PyPy)))]
#[cfg_attr(docsrs, doc(cfg(all(Py_3_9, not(PyPy)))))]
pub fn PyInterpreterState_Get() -> *mut PyInterpreterState;

#[cfg(all(Py_3_8, not(PyPy)))]
#[cfg_attr(docsrs, doc(cfg(all(Py_3_8, not(PyPy)))))]
pub fn PyInterpreterState_GetDict(arg1: *mut PyInterpreterState) -> *mut PyObject;

#[cfg(all(Py_3_7, not(PyPy)))]
#[cfg_attr(docsrs, doc(cfg(all(Py_3_7, not(PyPy)))))]
pub fn PyInterpreterState_GetID(arg1: *mut PyInterpreterState) -> i64;

#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyState_AddModule(arg1: *mut PyObject, arg2: *mut PyModuleDef) -> c_int;

#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyState_RemoveModule(arg1: *mut PyModuleDef) -> c_int;

#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyState_FindModule(arg1: *mut PyModuleDef) -> *mut PyObject;

#[cfg_attr(PyPy, link_name = "PyPyThreadState_New")]
Expand All @@ -68,7 +59,6 @@ extern "C" {
#[cfg_attr(PyPy, link_name = "PyPyThreadState_GetDict")]
pub fn PyThreadState_GetDict() -> *mut PyObject;
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyThreadState_SetAsyncExc(arg1: c_long, arg2: *mut PyObject) -> c_int;
}

Expand All @@ -89,6 +79,5 @@ extern "C" {
#[cfg_attr(PyPy, link_name = "PyPyGILState_Release")]
pub fn PyGILState_Release(arg1: PyGILState_STATE);
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyGILState_GetThisThreadState() -> *mut PyThreadState;
}
1 change: 0 additions & 1 deletion src/ffi/setobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ pub unsafe fn PyAnySet_Check(ob: *mut PyObject) -> c_int {

#[inline]
#[cfg(Py_3_10)]
#[cfg_attr(docsrs, doc(cfg(Py_3_10)))]
pub unsafe fn PySet_CheckExact(op: *mut PyObject) -> c_int {
crate::ffi::Py_IS_TYPE(op, &mut PySet_Type)
}
Expand Down
3 changes: 0 additions & 3 deletions src/ffi/structseq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ extern "C" {
) -> c_int;

#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyStructSequence_NewType(desc: *mut PyStructSequence_Desc) -> *mut PyTypeObject;
#[cfg_attr(PyPy, link_name = "PyPyStructSequence_New")]
pub fn PyStructSequence_New(_type: *mut PyTypeObject) -> *mut PyObject;
Expand All @@ -57,10 +56,8 @@ pub unsafe fn PyStructSequence_GET_ITEM(op: *mut PyObject, i: Py_ssize_t) -> *mu

extern "C" {
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyStructSequence_SetItem(arg1: *mut PyObject, arg2: Py_ssize_t, arg3: *mut PyObject);

#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn PyStructSequence_GetItem(arg1: *mut PyObject, arg2: Py_ssize_t) -> *mut PyObject;
}
2 changes: 0 additions & 2 deletions src/ffi/unicodeobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,9 @@ extern "C" {
#[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUTF8String")]
pub fn PyUnicode_AsUTF8String(unicode: *mut PyObject) -> *mut PyObject;
#[cfg(any(Py_3_10, all(Py_3_7, not(Py_LIMITED_API))))]
#[cfg_attr(docsrs, doc(cfg(any(Py_3_10, not(Py_LIMITED_API)))))]
#[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUTF8AndSize")]
pub fn PyUnicode_AsUTF8AndSize(unicode: *mut PyObject, size: *mut Py_ssize_t) -> *const c_char;
#[cfg(not(any(Py_3_7, Py_LIMITED_API)))]
#[cfg_attr(docsrs, doc(cfg(any(Py_3_10, not(Py_LIMITED_API)))))]
#[cfg_attr(PyPy, link_name = "PyPyUnicode_AsUTF8AndSize")]
pub fn PyUnicode_AsUTF8AndSize(unicode: *mut PyObject, size: *mut Py_ssize_t) -> *mut c_char;
#[cfg_attr(PyPy, link_name = "PyPyUnicode_DecodeUTF32")]
Expand Down
2 changes: 0 additions & 2 deletions src/gil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ pub(crate) fn gil_is_acquired() -> bool {
/// # }
/// ```
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
#[allow(clippy::collapsible_if)] // for if cfg!
pub fn prepare_freethreaded_python() {
// Protect against race conditions when Python is not yet initialized and multiple threads
Expand Down Expand Up @@ -135,7 +134,6 @@ pub fn prepare_freethreaded_python() {
/// # }
/// ```
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
#[allow(clippy::collapsible_if)] // for if cfg!
pub unsafe fn with_embedded_python_interpreter<F, R>(f: F) -> R
where
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ pub use crate::conversion::{
};
pub use crate::err::{PyDowncastError, PyErr, PyErrArguments, PyResult};
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub use crate::gil::{prepare_freethreaded_python, with_embedded_python_interpreter};
pub use crate::gil::{GILGuard, GILPool};
pub use crate::instance::{Py, PyNativeType, PyObject};
Expand Down Expand Up @@ -355,7 +354,6 @@ pub mod proc_macro {
pub use pyo3_macros::{pyclass, pyfunction, pymethods, pymodule, pyproto};
}

#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
#[cfg(feature = "macros")]
pub use pyo3_macros::{pyclass, pyfunction, pymethods, pymodule, pyproto, FromPyObject};

Expand Down
2 changes: 1 addition & 1 deletion src/marshal.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg(not(Py_LIMITED_API))]
#![cfg_attr(docsrs, doc(cfg(not(Py_LIMITED_API))))]

//! Support for the Python `marshal` format.

use crate::ffi;
Expand Down
1 change: 0 additions & 1 deletion src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ pub use crate::python::Python;
pub use crate::types::{PyAny, PyModule};
pub use crate::wrap_pyfunction;

#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
#[cfg(feature = "macros")]
pub use pyo3_macros::{pyclass, pyfunction, pymethods, pymodule, pyproto, FromPyObject};
1 change: 0 additions & 1 deletion src/types/complex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ impl PyComplex {
}

#[cfg(not(any(Py_LIMITED_API, PyPy)))]
#[cfg_attr(docsrs, doc(cfg(not(any(Py_LIMITED_API, PyPy)))))]
mod not_limited_impls {
use super::*;
use std::ops::{Add, Div, Mul, Neg, Sub};
Expand Down
1 change: 0 additions & 1 deletion src/types/dict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ impl PyDict {
/// Returns an error on invalid input. In the case of key collisions,
/// this keeps the last entry seen.
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn from_sequence(py: Python, seq: PyObject) -> PyResult<&PyDict> {
unsafe {
let dict = py.from_owned_ptr::<PyDict>(ffi::PyDict_New());
Expand Down
1 change: 0 additions & 1 deletion src/types/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ impl<'p> Iterator for &'p PyIterator {

// PyIter_Check does not exist in the limited API until 3.8
#[cfg(any(not(Py_LIMITED_API), Py_3_8))]
#[cfg_attr(docsrs, doc(cfg(any(not(Py_LIMITED_API), Py_3_8))))]
impl<'v> PyTryFrom<'v> for PyIterator {
fn try_from<V: Into<&'v PyAny>>(value: V) -> Result<&'v PyIterator, PyDowncastError<'v>> {
let value = value.into();
Expand Down
1 change: 0 additions & 1 deletion src/types/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ impl PyList {
///
/// Caller must verify that the index is within the bounds of the list.
#[cfg(not(any(Py_LIMITED_API, PyPy)))]
#[cfg_attr(docsrs, doc(cfg(not(any(Py_LIMITED_API, PyPy)))))]
pub unsafe fn get_item_unchecked(&self, index: usize) -> &PyAny {
let item = ffi::PyList_GET_ITEM(self.as_ptr(), index as Py_ssize_t);
// PyList_GET_ITEM return borrowed ptr; must make owned for safety (see #890).
Expand Down
2 changes: 0 additions & 2 deletions src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pub use self::bytearray::PyByteArray;
pub use self::bytes::PyBytes;
pub use self::complex::PyComplex;
#[cfg(not(Py_LIMITED_API))]
#[cfg_attr(docsrs, doc(cfg(not(Py_LIMITED_API))))]
pub use self::datetime::{
PyDate, PyDateAccess, PyDateTime, PyDelta, PyDeltaAccess, PyTime, PyTimeAccess, PyTzInfo,
};
Expand Down Expand Up @@ -225,7 +224,6 @@ mod bytearray;
mod bytes;
mod complex;
#[cfg(not(Py_LIMITED_API))]
#[cfg_attr(docsrs, doc(cfg(not(Py_LIMITED_API))))]
mod datetime;
mod dict;
mod floatob;
Expand Down
1 change: 0 additions & 1 deletion src/types/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ impl PyModule {
///
/// May fail if the module does not have a `__file__` attribute.
#[cfg(not(all(windows, PyPy)))]
#[cfg_attr(docsrs, doc(cfg(not(all(windows, PyPy)))))]
pub fn filename(&self) -> PyResult<&str> {
use crate::types::PyString;
unsafe {
Expand Down
1 change: 0 additions & 1 deletion src/types/sequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ impl PySequence {
/// number of keys for which `self[key] == value`.
#[inline]
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
pub fn count<V>(&self, value: V) -> PyResult<usize>
where
V: ToBorrowedObject,
Expand Down
2 changes: 0 additions & 2 deletions src/types/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use std::str;
/// Python internally stores strings in various representations. This enumeration
/// represents those variations.
#[cfg(not(any(Py_LIMITED_API, target_endian = "big")))]
#[cfg_attr(docsrs, doc(cfg(not(any(Py_LIMITED_API, target_endian = "big")))))]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PyStringData<'a> {
/// UCS1 representation.
Expand Down Expand Up @@ -225,7 +224,6 @@ impl PyString {
///
/// For example, it is known not to work on big-endian platforms.
#[cfg(not(any(Py_LIMITED_API, target_endian = "big")))]
#[cfg_attr(docsrs, doc(cfg(not(any(Py_LIMITED_API, target_endian = "big")))))]
pub unsafe fn data(&self) -> PyResult<PyStringData<'_>> {
let ptr = self.as_ptr();

Expand Down
Loading