Skip to content

Commit

Permalink
Fix clippy and changelog CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen-CH-Leung committed Dec 21, 2024
1 parent 3a0c196 commit 40d38f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
File renamed without changes.
14 changes: 3 additions & 11 deletions src/types/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ mod tests {
let list = ob.downcast::<PyList>().unwrap();

let mut iter = list.iter();
assert_eq!(iter.nth(0).unwrap().extract::<i32>().unwrap(), 6);
iter.next();
assert_eq!(iter.nth(1).unwrap().extract::<i32>().unwrap(), 8);
assert_eq!(iter.nth(1).unwrap().extract::<i32>().unwrap(), 10);
assert!(iter.nth(1).is_none());
Expand All @@ -765,7 +765,7 @@ mod tests {
let list = ob.downcast::<PyList>().unwrap();

let mut iter = list.iter();
assert!(iter.nth(0).is_none());
iter.next();
assert!(iter.nth(1).is_none());

let v = vec![1, 2, 3];
Expand All @@ -775,14 +775,6 @@ mod tests {
let mut iter = list.iter();
assert!(iter.nth(10).is_none());

let v = vec![10];
let ob = (&v).into_pyobject(py).unwrap();
let list = ob.downcast::<PyList>().unwrap();

let mut iter = list.iter();
assert_eq!(iter.nth(0).unwrap().extract::<i32>().unwrap(), 10);
assert!(iter.nth(0).is_none());

let v = vec![6, 7, 8, 9, 10];
let ob = (&v).into_pyobject(py).unwrap();
let list = ob.downcast::<PyList>().unwrap();
Expand All @@ -794,7 +786,7 @@ mod tests {
let mut iter = list.iter();
iter.nth_back(1);
assert_eq!(iter.nth(2).unwrap().extract::<i32>().unwrap(), 8);
assert!(iter.nth(0).is_none());
assert!(iter.next().is_none());
});
}

Expand Down

0 comments on commit 40d38f3

Please sign in to comment.