Created
October 27, 2019 02:39
-
-
Save martinmroz/0cc0224ca24541edf176e67ba38e9f20 to your computer and use it in GitHub Desktop.
Parallelized version of our counter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Computes the flux over the provided input byte string. | |
fn flux_over_byte_string<T>(input: T) -> Option<Flux> | |
where | |
T: AsRef<[u8]> { | |
input.as_ref() | |
.par_iter() | |
.cloned() | |
.map(Flux::from) | |
.fold(|| None, |acc, next| span_opt(acc, Some(next))) | |
.reduce(|| None, |acc, next| span_opt(acc, next)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment