     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62

    // Check that we are flagged for ignoring `must_use` parallel adaptors.
    // (unfortunately there's no error code for `unused_must_use`)

    macro_rules! must_use {
        ($( $name:ident #[$expr:meta] )*) => {$(
            /// First sanity check that the expression is OK.
            ///
            /// ```
            /// #![deny(unused_must_use)]
            ///
            /// use rayon::prelude::*;
            ///
            /// let v: Vec<_> = (0..100).map(Some).collect();
            /// let _ =
            #[$expr]
            /// ```
            ///
            /// Now trigger the `must_use`.
            ///
            /// ```compile_fail
            /// #![deny(unused_must_use)]
            ///
            /// use rayon::prelude::*;
            ///
            /// let v: Vec<_> = (0..100).map(Some).collect();
            #[$expr]
            /// ```
            mod $name {}
        )*}
    }

    must_use! {
        chain               /** v.par_iter().chain(&v); */
        chunks              /** v.par_iter().chunks(2); */
        cloned              /** v.par_iter().cloned(); */
        enumerate           /** v.par_iter().enumerate(); */
        filter              /** v.par_iter().filter(|_| true); */
        filter_map          /** v.par_iter().filter_map(|x| *x); */
        flat_map            /** v.par_iter().flat_map(|x| *x); */
        flatten             /** v.par_iter().flatten(); */
        fold                /** v.par_iter().fold(|| 0, |x, _| x); */
        fold_with           /** v.par_iter().fold_with(0, |x, _| x); */
        try_fold            /** v.par_iter().try_fold(|| 0, |x, _| Some(x)); */
        try_fold_with       /** v.par_iter().try_fold_with(0, |x, _| Some(x)); */
        inspect             /** v.par_iter().inspect(|_| {}); */
        interleave          /** v.par_iter().interleave(&v); */
        interleave_shortest /** v.par_iter().interleave_shortest(&v); */
        intersperse         /** v.par_iter().intersperse(&None); */
        map                 /** v.par_iter().map(|x| x); */
        map_with            /** v.par_iter().map_with(0, |_, x| x); */
        map_init            /** v.par_iter().map_init(|| 0, |_, x| x); */
        panic_fuse          /** v.par_iter().panic_fuse(); */
        rev                 /** v.par_iter().rev(); */
        skip                /** v.par_iter().skip(1); */
        take                /** v.par_iter().take(1); */
        update              /** v.par_iter().update(|_| {}); */
        while_some          /** v.par_iter().cloned().while_some(); */
        with_max_len        /** v.par_iter().with_max_len(1); */
        with_min_len        /** v.par_iter().with_min_len(1); */
        zip                 /** v.par_iter().zip(&v); */
        zip_eq              /** v.par_iter().zip_eq(&v); */
    }

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)