Skip to content

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

GuillaumeGomez
Copy link
Member

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 8, 2025
@oli-obk
Copy link
Contributor

oli-obk commented Jul 8, 2025

Maybe add some tests showing the error when the size was chosen wrong

@GuillaumeGomez
Copy link
Member Author

Oh right. Adding ui tests for that. Very good idea!

@rustbot

This comment was marked as outdated.

@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Jul 8, 2025
@GuillaumeGomez
Copy link
Member Author

So sadly, I couldn't make the ui test work for various reasons explained in the run-make test. If someone has an idea, I'd love to hear it. In the meantime, I guess it's good enough?

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the int_format_into-improvement branch from 5a05f0f to 25f59e2 Compare July 8, 2025 13:51
@GuillaumeGomez GuillaumeGomez force-pushed the int_format_into-improvement branch from 25f59e2 to 82d9d62 Compare July 8, 2025 13:56
@jieyouxu jieyouxu removed the A-run-make Area: port run-make Makefiles to rmake.rs label Jul 8, 2025
///
#[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.

Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants