Module rayon::compile_fail::must_use::fold_chunks_with

source ·
Expand description

First sanity check that the expression is OK.

#![deny(unused_must_use)]

use rayon::prelude::*;

let v: Vec<_> = (0..100).map(Some).collect();
let _ =
 v.par_iter().fold_chunks_with(2, 0, |x, _| x); 

Now trigger the must_use.

#![deny(unused_must_use)]

use rayon::prelude::*;

let v: Vec<_> = (0..100).map(Some).collect();
 v.par_iter().fold_chunks_with(2, 0, |x, _| x);