You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move generic DivRem <T,U> to num/traits/ops and expose legacy bridge
* New file `corelib/src/num/traits/ops/divrem.cairo`
– defines the generic `DivRem<T,U>` trait (was in core traits.cairo).
– adds the `by_divrem_legacy::Bridge` adapter that maps every existing
symmetric `crate::traits::DivRem<T>` implementation to
`DivRem<T,T>` so old code keeps compiling.
– publishes concrete aliases (`DivRemU8 … DivRemU256`) outside the
module, per review guidelines.
* `corelib/src/num/traits/ops.cairo`
– re-exports `DivRem`, making it part of the public numeric-ops API.
* `corelib/src/num/traits.cairo`
– bubbles the new trait up alongside the other `num::traits` re-exports.
* `corelib/src/traits.cairo`
– removes the now-redundant generic-DivRem definition and restores the
legacy `DivRem<T>` docs (no longer marked deprecated).
These edits address reviewer feedback on PR #7722:
• trait must live under `num/traits/ops`
• drop the “Generic” suffix
• inner adapter module should stay private; concrete `pub impl`s live
at top level.
All existing tests pass, and the new `divrem` tests in `num_test.cairo`
verify both generic and legacy paths.
0 commit comments