Skip to content

Commit

Permalink
Take the batch builder by-value (#1493)
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 authored Jan 23, 2024
1 parent eb12dcf commit 662a84e
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 @@ -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 }
}
}

Expand Down

0 comments on commit 662a84e

Please sign in to comment.