Skip to content

Commit

Permalink
Take the batch builder by-value
Browse files Browse the repository at this point in the history
Small nit, but builders generally take `self` by value to avoid cloning
necessarily.
  • Loading branch information
Stebalien committed Jan 10, 2024
1 parent f8916da commit 41aeff2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions runtime/src/util/batch_return.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,8 @@ impl BatchReturnGen {
self
}

pub fn gen(&self) -> BatchReturn {
pub fn gen(self) -> BatchReturn {
assert_eq!(self.expect_count, self.success_count + self.fail_codes.len(), "programmer error, mismatched batch size {} and processed count {} batch return must include success/fail for all inputs", self.expect_count, self.success_count + self.fail_codes.len());
BatchReturn {
success_count: self.success_count as u32,
fail_codes: self.fail_codes.clone(),
}
BatchReturn { success_count: self.success_count as u32, fail_codes: self.fail_codes }
}
}

0 comments on commit 41aeff2

Please sign in to comment.