diff --git a/bingus/src/bin_/bytes.rs b/bingus/src/bin_/bytes.rs index c1498f2..c286c06 100644 --- a/bingus/src/bin_/bytes.rs +++ b/bingus/src/bin_/bytes.rs @@ -1,6 +1,6 @@ use std::convert::Infallible; -use rayon::iter::{IntoParallelIterator, ParallelIterator}; +use rayon::iter::{IntoParallelRefMutIterator, ParallelIterator}; use crate::{Bendable, Bytes, IntoDataBytes, TryFromDataBytes}; @@ -23,8 +23,9 @@ impl TryFromDataBytes for Bytes { impl Bendable for Bytes { type Unit = u8; - fn map Self::Unit + Sync>(self, f: F) -> Self { - self.into_par_iter().map(|e| f(&e)).collect() + fn map Self::Unit + Sync>(mut self, f: F) -> Self { + self.par_iter_mut().for_each(|e| *e = f(e)); + self } fn format() -> crate::Format { crate::Format::Binary