Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Caution Review the following alerts detected in dependencies. According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. It is recommended to resolve "Warn" alerts too. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| panic!("number() called on pair"); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Unused public malachite_number method on Allocator
Low Severity
The newly added pub fn malachite_number on Allocator has no callers anywhere in the codebase. A grep for .malachite_number( returns zero matches. While new_malachite_number is called from op_add and malachite_number_from_u8 is used in more_ops.rs, the reader counterpart malachite_number is dead code.
| let bytes = v.to_signed_bytes_be(); | ||
|
|
||
| self.new_atom_from_bigint_bytes(bytes.as_slice()) | ||
| } |
There was a problem hiding this comment.
Duplicated new_number and new_malachite_number implementations
Low Severity
new_malachite_number is an exact copy of new_number with only the parameter type changed. Similarly, malachite_number_from_u8 duplicates number_from_u8, and malachite_number duplicates number. Both Number and Malachite already share ToPrimitive (used in new_small_number_from_bigint); a similar trait-based approach for to_signed_bytes_be/from_signed_bytes_be could unify these three pairs of functions.


Note
Medium Risk
Introduces a second bigint backend and routes
+through it, which may subtly change arithmetic behavior/perf and increases dependency surface; core allocator number encoding is also refactored but kept logically equivalent.Overview
Adds
malachite-bigint(and transitive deps) to the workspace and exposes a newMalachitebigint type plusmalachite_number_from_u8conversion helper.Extends
Allocatorwithnew_malachite_number()andmalachite_number()and refactors number allocation to share small-int detection and atom creation from signed-byte buffers.Updates the
+operator implementation (op_add) to accumulate usingMalachiteand allocate the result via the new allocator path; includes minor test expectation tweaks where an empty vec literal is asserted.Written by Cursor Bugbot for commit 0e5018b. This will update automatically on new commits. Configure here.