Skip to content
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

std: Tweak some unstable features of str #23461

Merged
merged 1 commit into from
Mar 18, 2015

Conversation

alexcrichton
Copy link
Member

This commit clarifies some of the unstable features in the str module by
moving them out of the blanket core and collections features.

The following methods were moved to the str_char feature which generally
encompasses decoding specific characters from a str and dealing with the
result. It is unclear if any of these methods need to be stabilized for 1.0 and
the most conservative route for now is to continue providing them but to leave
them as unstable under a more specific name.

  • is_char_boundary
  • char_at
  • char_range_at
  • char_at_reverse
  • char_range_at_reverse
  • slice_shift_char

The following methods were moved into the generic unicode feature as they are
specifically enabled by the unicode crate itself.

  • nfd_chars
  • nfkd_chars
  • nfc_chars
  • graphemes
  • grapheme_indices
  • width

@rust-highfive
Copy link
Collaborator

r? @gankro

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

r? @aturon

@rust-highfive rust-highfive assigned aturon and unassigned Gankra Mar 17, 2015
@alexcrichton
Copy link
Member Author

cc #9387, but doesn't quite fix it as there is still a decision left to be made

@aturon
Copy link
Member

aturon commented Mar 17, 2015

@bors: r+ 53f493c

This commit clarifies some of the unstable features in the `str` module by
moving them out of the blanket `core` and `collections` features.

The following methods were moved to the `str_char` feature which generally
encompasses decoding specific characters from a `str` and dealing with the
result. It is unclear if any of these methods need to be stabilized for 1.0 and
the most conservative route for now is to continue providing them but to leave
them as unstable under a more specific name.

* `is_char_boundary`
* `char_at`
* `char_range_at`
* `char_at_reverse`
* `char_range_at_reverse`
* `slice_shift_char`

The following methods were moved into the generic `unicode` feature as they are
specifically enabled by the `unicode` crate itself.

* `nfd_chars`
* `nfkd_chars`
* `nfc_chars`
* `graphemes`
* `grapheme_indices`
* `width`
@alexcrichton
Copy link
Member Author

@bors: r=aturon

@bors
Copy link
Contributor

bors commented Mar 18, 2015

📌 Commit aa88da6 has been approved by aturon

@aturon aturon mentioned this pull request Mar 18, 2015
91 tasks
break;
}
i = range.next;
i += ch.len_utf8();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to wonder whether LLVM would optimize out this operation (decoding from UTF-8 and getting the length from the result of the decoding, instead of having it as a by-product) on @Kimundi's utf8x4 semi-hypothetical replacement for char.

Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 18, 2015
 This commit clarifies some of the unstable features in the `str` module by
moving them out of the blanket `core` and `collections` features.

The following methods were moved to the `str_char` feature which generally
encompasses decoding specific characters from a `str` and dealing with the
result. It is unclear if any of these methods need to be stabilized for 1.0 and
the most conservative route for now is to continue providing them but to leave
them as unstable under a more specific name.

* `is_char_boundary`
* `char_at`
* `char_range_at`
* `char_at_reverse`
* `char_range_at_reverse`
* `slice_shift_char`

The following methods were moved into the generic `unicode` feature as they are
specifically enabled by the `unicode` crate itself.

* `nfd_chars`
* `nfkd_chars`
* `nfc_chars`
* `graphemes`
* `grapheme_indices`
* `width`
@bors bors merged commit aa88da6 into rust-lang:master Mar 18, 2015
@alexcrichton alexcrichton deleted the feat-char-at branch March 19, 2015 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants