-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored bounded_int_trim. #7062
Conversation
3e786b1
to
2031d17
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @orizi)
corelib/src/internal/bounded_int.cairo
line 129 at r1 (raw file):
} pub impl Max<T, const MIN: felt252, const MAX: felt252> of super::TrimMaxHelper<T> { type Target = super::BoundedInt<MIN, MAX>;
Can't you use MAX - 1
(where MAX
is taken from another unrelated trait)? Why do you need all these helpers?
crates/cairo-lang-sierra/src/extensions/modules/bounded_int.rs
line 397 at r1 (raw file):
const STR_ID: &'static str = if ABOVE { "bounded_int_trim_max" } else { "bounded_int_trim_min" };
Maybe rename ABOVE
to IS_MAX
? To be consistent with the min
, max
naming?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @liorgold2)
corelib/src/internal/bounded_int.cairo
line 129 at r1 (raw file):
Previously, liorgold2 wrote…
Can't you use
MAX - 1
(whereMAX
is taken from another unrelated trait)? Why do you need all these helpers?
hmm - probably in some way - but probably not for this PR.
additionally, calculations of generic params to be used as generic args is problematic (and definitely not supported on 2.10.* and only partially on main)
crates/cairo-lang-sierra/src/extensions/modules/bounded_int.rs
line 397 at r1 (raw file):
Previously, liorgold2 wrote…
Maybe rename
ABOVE
toIS_MAX
? To be consistent with themin
,max
naming?
Done.
Not updating the given range. Splitting into `bounded_int_trim_min` and `bounded_int_trim_max`.
2031d17
to
3e72a69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @orizi)
…7087) chore: orthographic correction in file if_else (#7088) prevents closure parameters from being declared as refrences (#7078) Refactored bounded_int_trim. (#7062) Added const for starknet types. (#6961) feat(corelib): Iterator::fold (#7084) feat(corelib): Iterator::advance_by (#7059) fix(corelib): Add the #[test] annotation to enumerate test (#7098) feat(corelib): storage vectors iterators (#6941) Extract ModuleHelper from const folding. (#7099) Added support for basic `Into`s in consts. (#7100) Removed taking value for `validate_literal`. (#7101) added closure params to semantic defs in lowering (#7085) Added support for `downcast` in constant context. (#7102) fix(corelib): Add the #[test] annotation to enumerate test (#7098)
feat(corelib): Iterator::enumerate (#7048) fix: Fix handling of --skip-first argument Update release_crates.sh (#7087) chore: orthographic correction in file if_else (#7088) prevents closure parameters from being declared as refrences (#7078) Refactored bounded_int_trim. (#7062) Added const for starknet types. (#6961) feat(corelib): Iterator::fold (#7084) feat(corelib): Iterator::advance_by (#7059) fix(corelib): Add the #[test] annotation to enumerate test (#7098) feat(corelib): storage vectors iterators (#6941) Extract ModuleHelper from const folding. (#7099) Added support for basic `Into`s in consts. (#7100) Removed taking value for `validate_literal`. (#7101) added closure params to semantic defs in lowering (#7085) Added support for `downcast` in constant context. (#7102) fix(corelib): Add the #[test] annotation to enumerate test (#7098)
feat(corelib): Iterator::enumerate (#7048) fix: Fix handling of --skip-first argument Update release_crates.sh (#7087) chore: orthographic correction in file if_else (#7088) prevents closure parameters from being declared as refrences (#7078) Refactored bounded_int_trim. (#7062) Added const for starknet types. (#6961) feat(corelib): Iterator::fold (#7084) feat(corelib): Iterator::advance_by (#7059) fix(corelib): Add the #[test] annotation to enumerate test (#7098) feat(corelib): storage vectors iterators (#6941) Extract ModuleHelper from const folding. (#7099) Added support for basic `Into`s in consts. (#7100) Removed taking value for `validate_literal`. (#7101) added closure params to semantic defs in lowering (#7085) Added support for `downcast` in constant context. (#7102) fix(corelib): Add the #[test] annotation to enumerate test (#7098)
Not updating the given range.
Splitting into
bounded_int_trim_min
andbounded_int_trim_max
.