Skip to content

Commit fb69b75

Browse files
committed
remove unnecessary mut for par_render
1 parent e3d95fd commit fb69b75

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

benches/benchmark.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fn bench_zapper(c: &mut Criterion) {
6767

6868
// build up a group of 100 (similar) people
6969
let mut group = vec![];
70-
for i in 0..10000 {
70+
for i in 0..100 {
7171
group.push(Person {
7272
id: 12 + i,
7373
name: "Bob".to_string(),
@@ -93,7 +93,7 @@ fn bench_zapper_par(c: &mut Criterion) {
9393
provider: "apns".to_string(),
9494
provider_code: 31,
9595
};
96-
let mut bytecode = match compile(template, &env) {
96+
let bytecode = match compile(template, &env) {
9797
Ok(bc) => bc,
9898
Err(err) => {
9999
eprintln!("error compiling template: {}", err);
@@ -105,7 +105,7 @@ fn bench_zapper_par(c: &mut Criterion) {
105105

106106
// build up a group of 100 (similar) people
107107
let mut group = vec![];
108-
for i in 0..10000 {
108+
for i in 0..100 {
109109
group.push(Person {
110110
id: 12 + i,
111111
name: "Bob".to_string(),

src/bytecode.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<
7474
}
7575

7676
/// Renders a template across multiple items in parallel using Rayon with
77-
/// convenient internally-managed buffers, which requires a mutable reference to self.
77+
/// convenient internally-managed buffers.
7878
///
7979
/// NOTE: This function makes serious trade-offs to enable the _maximum_ throughput.
8080
/// It is far less efficient, and builds up a single buffer containing all results
@@ -84,7 +84,7 @@ impl<
8484
/// Only use if total throughput is the sole concern.
8585
#[cfg(feature = "rayon")]
8686
pub fn par_render<'b, RunnerItem>(
87-
&mut self,
87+
&self,
8888
runner: &[RunnerItem],
8989
output: &mut Write,
9090
) -> Result<(), Vec<::std::io::Error>>

0 commit comments

Comments
 (0)