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 23, 2024
1 parent 4c13743 commit 26b76fd
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 48 deletions.
8 changes: 4 additions & 4 deletions src/extensions/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ pub trait Collection<Item> {
/// Basic usage:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![1, 2, 3];
///
Expand Down Expand Up @@ -312,7 +312,7 @@ pub trait Collection<Item> {
/// [`group_fold()`]: crate::CollectionInto::group_fold
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = vec![1, 2, 3];
Expand Down Expand Up @@ -343,7 +343,7 @@ pub trait Collection<Item> {
/// [`group_reduce()`]: crate::CollectionInto::group_reduce
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = vec![1, 2, 3];
Expand Down Expand Up @@ -611,7 +611,7 @@ pub trait Collection<Item> {
/// # Example
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// # let a_source = vec![1, 2, 3];
/// let a = vec![1, 2, 3];
Expand Down
48 changes: 24 additions & 24 deletions src/extensions/collection_into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ pub trait CollectionInto<Item> {
/// Basic usage:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![1, 2, 3];
///
Expand All @@ -340,7 +340,7 @@ pub trait CollectionInto<Item> {
/// situation, where the type of the closure is a double reference:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![&1, &2, &3];
///
Expand All @@ -355,7 +355,7 @@ pub trait CollectionInto<Item> {
/// one:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![&1, &2, &3];
///
Expand All @@ -369,7 +369,7 @@ pub trait CollectionInto<Item> {
/// or both:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![&0, &1, &2];
///
Expand Down Expand Up @@ -405,7 +405,7 @@ pub trait CollectionInto<Item> {
/// Basic usage:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![1, 2, 3];
///
Expand All @@ -420,7 +420,7 @@ pub trait CollectionInto<Item> {
/// situation, where the type of the closure is a double reference:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![&1, &2, &3];
///
Expand All @@ -435,7 +435,7 @@ pub trait CollectionInto<Item> {
/// one:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![&1, &2, &3];
///
Expand All @@ -449,7 +449,7 @@ pub trait CollectionInto<Item> {
/// or both:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![&0, &1, &2];
///
Expand Down Expand Up @@ -485,7 +485,7 @@ pub trait CollectionInto<Item> {
/// Basic usage:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![1, 2, 3];
///
Expand All @@ -498,7 +498,7 @@ pub trait CollectionInto<Item> {
/// Here's the same example, but with [`filter()`] and [`map()`]:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![1, 2, 3];
///
Expand Down Expand Up @@ -536,7 +536,7 @@ pub trait CollectionInto<Item> {
/// Basic usage:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![1, 2, 3];
///
Expand All @@ -549,7 +549,7 @@ pub trait CollectionInto<Item> {
/// Here's the same example, but with [`filter()`] and [`map_ref()`]:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![1, 2, 3];
///
Expand Down Expand Up @@ -606,7 +606,7 @@ pub trait CollectionInto<Item> {
/// Basic usage:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![vec![1, 2], vec![3]];
///
Expand All @@ -616,7 +616,7 @@ pub trait CollectionInto<Item> {
/// Mapping and then flattening:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![1, 2, 3];
///
Expand All @@ -631,7 +631,7 @@ pub trait CollectionInto<Item> {
/// in this case since it conveys intent more clearly:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![1, 2, 3];
///
Expand All @@ -645,7 +645,7 @@ pub trait CollectionInto<Item> {
/// Flattening works on any `IntoIterator` type, including `Option` and `Result`:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let options = vec![Some(123), Some(321), None, Some(231)];
/// let results = vec![Ok(123), Ok(321), Err(456), Ok(231)];
Expand All @@ -658,7 +658,7 @@ pub trait CollectionInto<Item> {
/// Flattening only removes one level of nesting at a time:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let d3 = vec![vec![vec![1, 2], vec![3, 4]], vec![vec![5, 6], vec![7, 8]]];
///
Expand Down Expand Up @@ -713,7 +713,7 @@ pub trait CollectionInto<Item> {
/// # Example
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![1, 2, 3];
///
Expand Down Expand Up @@ -758,7 +758,7 @@ pub trait CollectionInto<Item> {
/// # Example
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// let a = vec![1, 2, 3];
///
Expand Down Expand Up @@ -888,7 +888,7 @@ pub trait CollectionInto<Item> {
/// The discriminator function takes a reference to an element and returns a group key.
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = vec![1, 2, 3];
Expand Down Expand Up @@ -924,7 +924,7 @@ pub trait CollectionInto<Item> {
/// [`group_fold_ref()`]: crate::Collection::group_fold_ref
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = vec![1, 2, 3];
Expand Down Expand Up @@ -970,7 +970,7 @@ pub trait CollectionInto<Item> {
/// [`group_reduce_ref()`]: crate::Collection::group_reduce_ref
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = vec![1, 2, 3];
Expand Down Expand Up @@ -1013,7 +1013,7 @@ pub trait CollectionInto<Item> {
/// # Example
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashSet;
///
/// let a = vec![1, 2, 2, 3];
Expand Down Expand Up @@ -1352,7 +1352,7 @@ pub trait CollectionInto<Item> {
/// # Example
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
///
/// # let a_source = vec![1, 2, 3];
/// let a = vec![1, 2, 3];
Expand Down
24 changes: 12 additions & 12 deletions src/extensions/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ pub trait Map<Key, Value> {
/// # Example
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = HashMap::from([
Expand Down Expand Up @@ -569,7 +569,7 @@ pub trait Map<Key, Value> {
/// # Example
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = HashMap::from([
Expand Down Expand Up @@ -600,7 +600,7 @@ pub trait Map<Key, Value> {
/// # Example
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = HashMap::from([
Expand Down Expand Up @@ -634,7 +634,7 @@ pub trait Map<Key, Value> {
/// # Example
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = HashMap::from([
Expand Down Expand Up @@ -678,7 +678,7 @@ pub trait Map<Key, Value> {
/// Basic usage:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = HashMap::from([
Expand All @@ -697,7 +697,7 @@ pub trait Map<Key, Value> {
/// Here's the same example, but with [`filter()`] and [`map()`]:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = HashMap::from([
Expand Down Expand Up @@ -741,7 +741,7 @@ pub trait Map<Key, Value> {
/// Basic usage:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = HashMap::from([
Expand All @@ -760,7 +760,7 @@ pub trait Map<Key, Value> {
/// Here's the same example, but with [`filter()`] and [`map_ref()`]:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = HashMap::from([
Expand Down Expand Up @@ -903,7 +903,7 @@ pub trait Map<Key, Value> {
/// # Example
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = HashMap::from([
Expand Down Expand Up @@ -959,7 +959,7 @@ pub trait Map<Key, Value> {
/// # Example
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = HashMap::from([
Expand Down Expand Up @@ -1130,7 +1130,7 @@ pub trait Map<Key, Value> {
/// Basic usage:
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashMap;
///
/// let a = HashMap::from([
Expand Down Expand Up @@ -1166,7 +1166,7 @@ pub trait Map<Key, Value> {
/// # Example
///
/// ```
/// use crate::cantrip::*;
/// use cantrip::*;
/// use std::collections::HashSet;
/// use std::collections::HashMap;
///
Expand Down
Loading

0 comments on commit 26b76fd

Please sign in to comment.