-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Make int_format_into
API more flexible
#143636
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
base: master
Are you sure you want to change the base?
Make int_format_into
API more flexible
#143636
Conversation
Maybe add some tests showing the error when the size was chosen wrong |
Oh right. Adding |
This comment was marked as outdated.
This comment was marked as outdated.
So sadly, I couldn't make the |
This comment has been minimized.
This comment has been minimized.
5a05f0f
to
25f59e2
Compare
25f59e2
to
82d9d62
Compare
/// | ||
#[doc = concat!("let n = 32", stringify!($signed), ";")] | ||
/// // We use a `NumBuffer` used to store a bigger integer. | ||
/// let mut buf = NumBuffer::<u128>::new(); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
i128
and u128
are not covered by this macro, they are implemented below. So this example works all the time. :)
Also, if it didn't, the doctest would fail because compilation would fail.
Follow-up of #142098.
Part of #138215.
This change allows to pass
NumBuffer<u128>
for any smaller integers, making the API much more flexible overall.r? @Amanieu