Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Ockajak committed Jul 29, 2024
1 parent d686396 commit 46a3f90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let a = vec![1, 2, 3];

a.fold(0, |r, x| r + x); // 6

a.map_ref(|&x| (x, x + 1)).to_map(); // HashMap::from([(1, 2), (2, 3), (3, 4)])
a.map_ref(|&x| (x, x)).into_map(); // HashMap::from([(1, 1), (2, 2), (3, 3)])

a.flat_map(|x| [x, -x]).sorted(); // vec![-3, -2, -1, 1, 2, 3]

Expand All @@ -45,7 +45,7 @@ a.group_by(|x| x % 2); // HashMap::from([(0, vec![2]), (1,

a.delete(&1).add(2).unique(); // vec![2, 3]

a.substitute_at(0, 4).into_list(); // LinkedList::from([4, 2, 3])
a.substitute_at(0, 4).to_list(); // LinkedList::from([4, 2, 3])

a.position_multi(|&x| x % 2 == 1); // vec![0, 2]

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//! a.fold(0, |r, x| r + x); // 6
//!
//! # let a = source.clone();
//! a.map_ref(|&x| (x, x + 1)).to_map(); // HashMap::from([(1, 2), (2, 3), (3, 4)])
//! a.map_ref(|&x| (x, x)).into_map(); // HashMap::from([(1, 1), (2, 2), (3, 3)])
//!
//! # let a = source.clone();
//! a.flat_map(|x| [x, -x]).sorted(); // vec![-3, -2, -1, 1, 2, 3]
Expand All @@ -49,7 +49,7 @@
//! a.delete(&1).add(2).unique(); // vec![2, 3]
//!
//! # let a = source.clone();
//! a.substitute_at(0, 4).into_list(); // LinkedList::from([4, 2, 3])
//! a.substitute_at(0, 4).to_list(); // LinkedList::from([4, 2, 3])
//!
//! # let a = source.clone();
//! a.position_multi(|&x| x % 2 == 1); // vec![0, 2]
Expand Down

0 comments on commit 46a3f90

Please sign in to comment.