Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for make_ascii_{upper,lower}case #27809
Comments
alexcrichton
added
T-libs
B-unstable
labels
Aug 13, 2015
This comment has been minimized.
This comment has been minimized.
|
cc @SimonSapin |
This comment has been minimized.
This comment has been minimized.
|
Minor correction: Rc::make_unique is another example of this naming.
|
This comment has been minimized.
This comment has been minimized.
|
There should be a way to do this operation without allocating. I don’t have a strong opinion on in place with |
SimonSapin
referenced this issue
Aug 13, 2015
Closed
Tracking issue for str::slice_mut_unchecked #27793
This comment has been minimized.
This comment has been minimized.
|
I don't like the |
This comment has been minimized.
This comment has been minimized.
|
I would prefer consuming the given String too. |
This comment has been minimized.
This comment has been minimized.
|
The |
This comment has been minimized.
This comment has been minimized.
|
You can always iterate the |
This comment has been minimized.
This comment has been minimized.
|
As for naming, something like |
This comment has been minimized.
This comment has been minimized.
|
But I also think |
This comment has been minimized.
This comment has been minimized.
|
+1 for |
This comment has been minimized.
This comment has been minimized.
|
If the libs team has the bandwidth, I’d like to nominate this for discussion. To sum up, options are:
Both are equally general: at worst if all you have is a |
This comment has been minimized.
This comment has been minimized.
|
Also, it’s possible to build this out of tree: for byte in &mut (bytes: Vec<u8>) {
*byte = byte.to_ascii_lowercase()
}
for byte in unsafe { (s: String).as_mut_vec() } {
*byte = byte.to_ascii_lowercase()
}… though it would be nice to encapsulate the unsafety in the |
alexcrichton
added
the
I-nominated
label
Jan 22, 2016
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
added
final-comment-period
and removed
I-nominated
labels
Jan 29, 2016
This comment has been minimized.
This comment has been minimized.
|
What’s the rationale for not stabilizing any of the two proposed designs? |
This comment has been minimized.
This comment has been minimized.
|
Ah yes, to clarify we concluded that this stuck out enough and could be easily enough built on crates.io (e.g. externally) that it wasn't necessary to stabilize in libstd at this time. |
This comment has been minimized.
This comment has been minimized.
The same can be said of the entire |
This comment has been minimized.
This comment has been minimized.
|
Sure, but that part's already stable. The |
This comment has been minimized.
This comment has been minimized.
|
I’m not a big fan of What about |
This comment has been minimized.
This comment has been minimized.
|
If those methods could be merged into the |
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 1, 2016
SimonSapin
referenced this issue
Feb 1, 2016
Merged
Add AsciiExt::into_ascii_{upper,lower}case #31335
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 1, 2016
This comment has been minimized.
This comment has been minimized.
|
Alright. IIRC we had a separate trait because dynamically-sized types and methods taking See PR #31335. |
This comment has been minimized.
This comment has been minimized.
|
What do
Is that true? If so how do you handle If naming is still an issue with |
This was referenced Mar 6, 2016
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Mar 6, 2016
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Mar 6, 2016
aturon
added
the
I-nominated
label
Mar 9, 2016
alexcrichton
added
final-comment-period
and removed
I-nominated
labels
Mar 11, 2016
This comment has been minimized.
This comment has been minimized.
|
This API is going back into final comment period. We were previously unable to reach consensus on a good convention for
We've always been somewhat ambivalent about ASCII support in std, and have scaled it back over time, but at this point, we're reasonably committed to some core functionality, and we'd like to settle these remaining APIs. As such, we're going to:
We had a lengthy discussion in the libs team last time about conventions. The key problem is that mutating methods are usually reasonably clear verb forms (like Perhaps we can look at some other languages for inspiration on this convention. But let's try to get it settled this cycle. |
This comment has been minimized.
This comment has been minimized.
Is #32076 what you have in mind here? |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Mar 17, 2016
alexcrichton
referenced this issue
Mar 17, 2016
Merged
std: Revert addition of `into_ascii_*` methods #32314
bors
added a commit
that referenced
this issue
Mar 19, 2016
This comment has been minimized.
This comment has been minimized.
|
@SimonSapin I think you already saw, but for the record, #32314 is what we had in mind. |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Mar 24, 2016
This comment has been minimized.
This comment has been minimized.
|
Revisiting the naming concerns, I continue to feel like the sticking point is needing a verb, which we can get either through |
This comment has been minimized.
This comment has been minimized.
|
I agree that all nouns can be verbed, but since |
This comment has been minimized.
This comment has been minimized.
|
I agree with Simon's concerns about ambiguity. How about But in all seriousness, |
This comment has been minimized.
This comment has been minimized.
|
@SimonSapin Ah, that's an excellent point. Maybe the right thing to do is to stick with |
tormol
referenced this issue
Apr 6, 2016
Merged
Add traits IntoAscii* to replace (Owned)AsciiCast #17
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this issue during triage yesterday and the conclusion was to stabilize under the names |
alexcrichton commentedAug 13, 2015
This is a tracking issue for the unstable
asciifeature in the standard library. These functions have the somewhat odd naming scheme ofmake_*(not found elsewhere in the standard library). The utility with&mut stris also somewhat questionable as there's not a lot of support for that in the standard library.Overall this probably just largely needs a decision.