Skip to content

Commit

Permalink
Fix doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
filmor committed Jan 12, 2025
1 parent ff8e419 commit 5205a56
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rustler/src/wrapped_types/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ wrapper!(
/// the `Result`s out of the list. (Contains extra type annotations for clarity)
///
/// ```
/// # use rustler::{Term, NifResult};
/// # use rustler::types::list::ListIterator;
/// # use rustler::{Term, NifResult, ListIterator};
/// # fn list_iterator_example(list_term: Term) -> NifResult<Vec<i64>> {
/// let list_iterator: ListIterator = list_term.decode()?;
///
Expand All @@ -55,7 +54,7 @@ impl<'a> Iterator for ListIterator<'a> {
// TODO: This is unsafe as tail might not be a list.
self.0 = tail;
Some(head)
},
}
None => {
if self.is_empty_list() {
// We reached the end of the list, finish the iterator.
Expand Down

0 comments on commit 5205a56

Please sign in to comment.