Skip to content

Commit

Permalink
apply fix
Browse files Browse the repository at this point in the history
  • Loading branch information
julio4 committed Jan 6, 2025
1 parent bd4b3a0 commit 93d0cdb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 3 additions & 1 deletion corelib/src/iter/adapters.cairo
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
mod map;
pub use map::{Map, mapped_iterator};
pub use map::Map;
#[allow(unused_imports)]
pub(crate) use map::mapped_iterator;
4 changes: 1 addition & 3 deletions corelib/src/iter/adapters/map.cairo
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use crate::iter::Iterator;

/// An iterator that maps the values of `iter` with `f`.
///
/// This `struct` is created by the [`map`] method on [`Iterator`]. See its
Expand All @@ -15,7 +13,7 @@ pub struct Map<I, F> {
f: F,
}

pub(crate) fn mapped_iterator<I, F>(iter: I, f: F) -> Map<I, F> {
pub fn mapped_iterator<I, F>(iter: I, f: F) -> Map<I, F> {
Map { iter, f }
}

Expand Down
3 changes: 2 additions & 1 deletion corelib/src/iter/traits/iterator.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ pub trait Iterator<T> {
/// // don't do this:
/// let _ = (0..5_usize).into_iter().map(|x| println!("{x}"));
///
/// // it won't even execute, as it is lazy. Cairo will warn you about this.
/// // it won't even execute, as it is lazy. Cairo will warn you about this if not specifically
/// ignored, as is done here.
///
/// // Instead, use for:
/// for x in 0..5_usize {
Expand Down
2 changes: 0 additions & 2 deletions corelib/src/test/iter_test.cairo
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use crate::iter::{IntoIterator, Iterator};

#[test]
fn test_iter_adapter_map() {
let a = array![1, 2, 3];
Expand Down

0 comments on commit 93d0cdb

Please sign in to comment.