From 662a84ee28f61965cf4590dc4ddaf9c388ff3bed Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 23 Jan 2024 13:56:33 -0800 Subject: [PATCH] Take the batch builder by-value (#1493) Small nit, but builders generally take `self` by value to avoid cloning necessarily. --- runtime/src/util/batch_return.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/runtime/src/util/batch_return.rs b/runtime/src/util/batch_return.rs index 6198717c2..a4e7a68fe 100644 --- a/runtime/src/util/batch_return.rs +++ b/runtime/src/util/batch_return.rs @@ -170,12 +170,9 @@ impl BatchReturnGen { } } - 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 } } }