Conversation
Signed-off-by: daixihegu <daixihegu@163.com>
There was a problem hiding this comment.
Code Review
This pull request documents and clarifies the panic behavior of the padding helper functions when called with a zero multiple. Specifically, it adds an explicit assertion to compute_len_to_next_multiple to ensure multiple is non-zero, documents this behavior in the docstrings of both compute_len_to_next_multiple and pad_with_zeros, adds corresponding unit tests, and updates the CHANGELOG. There are no review comments, so we have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@mrain @philippecamacho @akonring Hi, Could you please review this PR at your convenience? Thank you very much. |
closes: #XXXX
This PR:
This PR clarifies the behavior of
jf-utilspadding helpers when they are called with a zero multiple.Previously,
compute_len_to_next_multiple(_, 0)panicked with Rust's modulo-by-zero message. This change adds an explicit assertion so callers get a clearer panic message, and documents the panic behavior for bothcompute_len_to_next_multipleandpad_with_zeros.This PR does not:
Key places to review:
cargo fmt -- --checkcargo test -p jf-utilscargo clippy -p jf-utils --all-targets -- -D warningsgit diff --checkBefore we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
CHANGELOG.mdof touched crates.Files changedin the GitHub PR explorer