-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Tracking Issue for {char, u8}::is_ascii_octdigit
#101288
Comments
@rustbot claim |
This method is also applicable to bytes, so the scope of this issue extends to |
char::is_ascii_octdigit
{char, u8}::is_ascii_octdigit
This has been unstable for more than a year, and since there are no reported issues or blockers I think this can be stabilized. The full API is this (note the impl {char,u8} {
pub const fn is_ascii_octdigit(&self) -> bool;
} |
Shall we stabilize is_ascii_octdigit? @rfcbot merge |
Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Every function we add comes at the cost of making it harder to find others, and u8 already has a very heavily-loaded API. I am concerned this doesn't pull its weight. Many new Rust programmers often flail for some time while looking for basic functions. In the past week I've had to coach people on locating basic things like |
@rfcbot concern does not pull its weight I'll file this concern because I'm not totally sold on this method either, but I lean towards including it. It fits right in with existing methods. With that said, octal notation is in my experience way less frequently used than either decimal or hexadecimal, so I'm not sold that it's worth adding a method specifically for it. We have at least a few examples where we load up types with lots of different methods, so I tend to think we should try to approach that problem in other ways. For example, improving rustdoc output. I am a casual user of separating methods into different groups based on categories that I think might be useful to others. Of course, one of the issues with this approach is that grouping is also somewhat determined by trait bounds, so this could overall be somewhat confusing given the status quo of rustdoc. |
I'm also not convinced this method is worth adding. (Would we also add On |
+1 to the feeling that For What's the counterproposal for let byte = b'7';
println!("{}", (byte as char).is_digit(8)); |
From the last couple comments, I get the sense this is not going to go through. @rfcbot fcp cancel |
@dtolnay proposal cancelled. |
Feature gate:
#![feature(is_ascii_octdigit)]
This is a tracking issue for two new methods
char::is_ascii_octdigit
andu8::is_ascii_octdigit
, which, in the same vein asis_ascii_hexdigit
, checks if a value is an ASCII octal digit ('0'..='7'
).This is a shorthand for
{char, u8}::is_digit(self, 8)
. Prior discussion on irlo.Public API
Steps / History
{char, u8}::is_ascii_octdigit
#101308Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩
The text was updated successfully, but these errors were encountered: