ci: fix beta clippy `map_clone` warning
This commit is contained in:
parent
5dbb51b9ce
commit
de93d15eeb
|
@ -1443,6 +1443,9 @@ where
|
|||
{
|
||||
/// Extracts `Self` from the source `PyObject`.
|
||||
fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self> {
|
||||
// TODO update MSRV past 1.59 and use .cloned() to make
|
||||
// clippy happy
|
||||
#[allow(clippy::map_clone)]
|
||||
ob.downcast().map(Clone::clone).map_err(Into::into)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -264,13 +264,13 @@ impl Sequence {
|
|||
self.values.len()
|
||||
}
|
||||
|
||||
fn __getitem__(&self, index: SequenceIndex<'_>) -> PyResult<PyObject> {
|
||||
fn __getitem__(&self, index: SequenceIndex<'_>, py: Python<'_>) -> PyResult<PyObject> {
|
||||
match index {
|
||||
SequenceIndex::Integer(index) => {
|
||||
let uindex = self.usize_index(index)?;
|
||||
self.values
|
||||
.get(uindex)
|
||||
.map(Clone::clone)
|
||||
.map(|o| o.clone_ref(py))
|
||||
.ok_or_else(|| PyIndexError::new_err(index))
|
||||
}
|
||||
// Just to prove that slicing can be implemented
|
||||
|
|
Loading…
Reference in New Issue