rust-lang / rust-lang/rust

Tracking Issue for APC #316: In-place case change methods for String

Open
#135,885 4 comments 0 reactions 1 assignee View on GitHub

@krtab is already working on this.

Since Jan 22, 2025.

C-tracking-issue T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Feature gate: #![feature(string_make_uplowercase)]

This is a tracking issue for APC #316

This APC proposes that a new API is added to String to change cases and do so efficiently by consuming self and reusing the buffer, not allocating in most cases.

The exact implementation remains to be discussed, but the idea would be that in cases where it is possible, the case change is done in place. Once that isn't possible, a auxiliary DE-queue can be used to store bytes temporarily.

Public API

This would add the following methods (names to be determined)

impl String {
	fn into_uppercase(&mut self);
	fn into_lowercase(&mut self);
}
Steps / History
  • Implementation: #135888
  • Final comment period (FCP)^1
  • Stabilization PR
Unresolved Questions
  • None yet.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.