///
/// For use with the `std::iter` module.
#[derive(Clone)]
-#[unstable(feature = "collections")]
+#[unstable(feature = "unicode",
+ reason = "this functionality may be replaced with a more generic \
+ unicode crate on crates.io")]
pub struct Decompositions<'a> {
kind: DecompositionType,
iter: Chars<'a>,
///
/// For use with the `std::iter` module.
#[derive(Clone)]
-#[unstable(feature = "collections")]
+#[unstable(feature = "unicode",
+ reason = "this functionality may be replaced with a more generic \
+ unicode crate on crates.io")]
pub struct Recompositions<'a> {
iter: Decompositions<'a>,
state: RecompositionState,
/// Returns an iterator over the string in Unicode Normalization Form D
/// (canonical decomposition).
#[inline]
- #[unstable(feature = "collections",
- reason = "this functionality may be moved to libunicode")]
+ #[unstable(feature = "unicode",
+ reason = "this functionality may be replaced with a more generic \
+ unicode crate on crates.io")]
fn nfd_chars(&self) -> Decompositions {
Decompositions {
iter: self[..].chars(),
/// Returns an iterator over the string in Unicode Normalization Form KD
/// (compatibility decomposition).
#[inline]
- #[unstable(feature = "collections",
- reason = "this functionality may be moved to libunicode")]
+ #[unstable(feature = "unicode",
+ reason = "this functionality may be replaced with a more generic \
+ unicode crate on crates.io")]
fn nfkd_chars(&self) -> Decompositions {
Decompositions {
iter: self[..].chars(),
/// An Iterator over the string in Unicode Normalization Form C
/// (canonical decomposition followed by canonical composition).
#[inline]
- #[unstable(feature = "collections",
- reason = "this functionality may be moved to libunicode")]
+ #[unstable(feature = "unicode",
+ reason = "this functionality may be replaced with a more generic \
+ unicode crate on crates.io")]
fn nfc_chars(&self) -> Recompositions {
Recompositions {
iter: self.nfd_chars(),
/// An Iterator over the string in Unicode Normalization Form KC
/// (compatibility decomposition followed by canonical composition).
#[inline]
- #[unstable(feature = "collections",
- reason = "this functionality may be moved to libunicode")]
+ #[unstable(feature = "unicode",
+ reason = "this functionality may be replaced with a more generic \
+ unicode crate on crates.io")]
fn nfkc_chars(&self) -> Recompositions {
Recompositions {
iter: self.nfkd_chars(),
/// // third byte of `老`
/// assert!(!s.is_char_boundary(8));
/// ```
- #[unstable(feature = "collections",
- reason = "naming is uncertain with container conventions")]
+ #[unstable(feature = "str_char",
+ reason = "it is unclear whether this method pulls its weight \
+ with the existence of the char_indices iterator or \
+ this method may want to be replaced with checked \
+ slicing")]
fn is_char_boundary(&self, index: usize) -> bool {
core_str::StrExt::is_char_boundary(&self[..], index)
}
/// 14: a
/// 15: m
/// ```
- #[unstable(feature = "collections",
- reason = "naming is uncertain with container conventions")]
+ #[unstable(feature = "str_char",
+ reason = "often replaced by char_indices, this method may \
+ be removed in favor of just char_at() or eventually \
+ removed altogether")]
fn char_range_at(&self, start: usize) -> CharRange {
core_str::StrExt::char_range_at(&self[..], start)
}
/// 6: 华
/// 3: 中
/// ```
- #[unstable(feature = "collections",
- reason = "naming is uncertain with container conventions")]
+ #[unstable(feature = "str_char",
+ reason = "often replaced by char_indices, this method may \
+ be removed in favor of just char_at() or eventually \
+ removed altogether")]
fn char_range_at_reverse(&self, start: usize) -> CharRange {
core_str::StrExt::char_range_at_reverse(&self[..], start)
}
/// assert_eq!(s.char_at(1), 'b');
/// assert_eq!(s.char_at(2), 'π');
/// ```
- #[unstable(feature = "collections",
- reason = "naming is uncertain with container conventions")]
+ #[unstable(feature = "str_char",
+ reason = "frequently replaced by the chars() iterator, this \
+ method may be removed or possibly renamed in the \
+ future; it is normally replaced by chars/char_indices \
+ iterators or by getting the first char from a \
+ subslice")]
fn char_at(&self, i: usize) -> char {
core_str::StrExt::char_at(&self[..], i)
}
/// assert_eq!(s.char_at_reverse(1), 'a');
/// assert_eq!(s.char_at_reverse(2), 'b');
/// ```
- #[unstable(feature = "collections",
- reason = "naming is uncertain with container conventions")]
+ #[unstable(feature = "str_char",
+ reason = "see char_at for more details, but reverse semantics \
+ are also somewhat unclear, especially with which \
+ cases generate panics")]
fn char_at_reverse(&self, i: usize) -> char {
core_str::StrExt::char_at_reverse(&self[..], i)
}
/// assert_eq!(c, 'ö');
/// assert_eq!(s2, "we 老虎 Léopard");
/// ```
- #[unstable(feature = "collections",
- reason = "awaiting conventions about shifting and slices")]
+ #[unstable(feature = "str_char",
+ reason = "awaiting conventions about shifting and slices and \
+ may not be warranted with the existence of the chars \
+ and/or char_indices iterators")]
fn slice_shift_char(&self) -> Option<(char, &str)> {
core_str::StrExt::slice_shift_char(&self[..])
}
///
/// assert_eq!(gr2.as_slice(), b);
/// ```
- #[unstable(feature = "collections",
- reason = "this functionality may only be provided by libunicode")]
+ #[unstable(feature = "unicode",
+ reason = "this functionality may be replaced with a more generic \
+ unicode crate on crates.io")]
fn graphemes(&self, is_extended: bool) -> Graphemes {
UnicodeStr::graphemes(&self[..], is_extended)
}
///
/// assert_eq!(gr_inds.as_slice(), b);
/// ```
- #[unstable(feature = "collections",
- reason = "this functionality may only be provided by libunicode")]
+ #[unstable(feature = "unicode",
+ reason = "this functionality may be replaced with a more generic \
+ unicode crate on crates.io")]
fn grapheme_indices(&self, is_extended: bool) -> GraphemeIndices {
UnicodeStr::grapheme_indices(&self[..], is_extended)
}
///
/// Control characters have zero width.
///
- /// `is_cjk` determines behavior for characters in the Ambiguous category: if `is_cjk` is
- /// `true`, these are 2 columns wide; otherwise, they are 1. In CJK locales, `is_cjk` should be
- /// `true`, else it should be `false`.
- /// [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/) recommends that these
- /// characters be treated as 1 column (i.e., `is_cjk = false`) if the locale is unknown.
- #[unstable(feature = "collections",
- reason = "this functionality may only be provided by libunicode")]
+ /// `is_cjk` determines behavior for characters in the Ambiguous category:
+ /// if `is_cjk` is `true`, these are 2 columns wide; otherwise, they are 1.
+ /// In CJK locales, `is_cjk` should be `true`, else it should be `false`.
+ /// [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/)
+ /// recommends that these characters be treated as 1 column (i.e., `is_cjk =
+ /// false`) if the locale is unknown.
+ #[unstable(feature = "unicode",
+ reason = "this functionality may be replaced with a more generic \
+ unicode crate on crates.io")]
fn width(&self, is_cjk: bool) -> usize {
UnicodeStr::width(&self[..], is_cjk)
}
/// Returns an iterator over the string in Unicode Normalization Form D
/// (canonical decomposition).
#[inline]
- #[unstable(feature = "collections",
- reason = "this functionality may be moved to libunicode")]
+ #[unstable(feature = "unicode",
+ reason = "this functionality may be replaced with a more generic \
+ unicode crate on crates.io")]
pub fn nfd_chars(&self) -> Decompositions {
Decompositions {
iter: self[..].chars(),
/// Returns an iterator over the string in Unicode Normalization Form KD
/// (compatibility decomposition).
#[inline]
- #[unstable(feature = "collections",
- reason = "this functionality may be moved to libunicode")]
+ #[unstable(feature = "unicode",
+ reason = "this functionality may be replaced with a more generic \
+ unicode crate on crates.io")]
pub fn nfkd_chars(&self) -> Decompositions {
Decompositions {
iter: self[..].chars(),
/// An Iterator over the string in Unicode Normalization Form C
/// (canonical decomposition followed by canonical composition).
#[inline]
- #[unstable(feature = "collections",
- reason = "this functionality may be moved to libunicode")]
+ #[unstable(feature = "unicode",
+ reason = "this functionality may be replaced with a more generic \
+ unicode crate on crates.io")]
pub fn nfc_chars(&self) -> Recompositions {
Recompositions {
iter: self.nfd_chars(),
/// An Iterator over the string in Unicode Normalization Form KC
/// (compatibility decomposition followed by canonical composition).
#[inline]
- #[unstable(feature = "collections",
- reason = "this functionality may be moved to libunicode")]
+ #[unstable(feature = "unicode",
+ reason = "this functionality may be replaced with a more generic \
+ unicode crate on crates.io")]
pub fn nfkc_chars(&self) -> Recompositions {
Recompositions {
iter: self.nfkd_chars(),
/// // third byte of `老`
/// assert!(!s.is_char_boundary(8));
/// ```
- #[unstable(feature = "collections",
- reason = "naming is uncertain with container conventions")]
+ #[unstable(feature = "str_char",
+ reason = "it is unclear whether this method pulls its weight \
+ with the existence of the char_indices iterator or \
+ this method may want to be replaced with checked \
+ slicing")]
pub fn is_char_boundary(&self, index: usize) -> bool {
core_str::StrExt::is_char_boundary(&self[..], index)
}
/// 14: a
/// 15: m
/// ```
- #[unstable(feature = "collections",
- reason = "naming is uncertain with container conventions")]
+ #[unstable(feature = "str_char",
+ reason = "often replaced by char_indices, this method may \
+ be removed in favor of just char_at() or eventually \
+ removed altogether")]
pub fn char_range_at(&self, start: usize) -> CharRange {
core_str::StrExt::char_range_at(&self[..], start)
}
/// 6: 华
/// 3: 中
/// ```
- #[unstable(feature = "collections",
- reason = "naming is uncertain with container conventions")]
+ #[unstable(feature = "str_char",
+ reason = "often replaced by char_indices, this method may \
+ be removed in favor of just char_at_reverse() or \
+ eventually removed altogether")]
pub fn char_range_at_reverse(&self, start: usize) -> CharRange {
core_str::StrExt::char_range_at_reverse(&self[..], start)
}
/// assert_eq!(s.char_at(1), 'b');
/// assert_eq!(s.char_at(2), 'π');
/// ```
- #[unstable(feature = "collections",
- reason = "naming is uncertain with container conventions")]
+ #[unstable(feature = "str_char",
+ reason = "frequently replaced by the chars() iterator, this \
+ method may be removed or possibly renamed in the \
+ future; it is normally replaced by chars/char_indices \
+ iterators or by getting the first char from a \
+ subslice")]
pub fn char_at(&self, i: usize) -> char {
core_str::StrExt::char_at(&self[..], i)
}
/// assert_eq!(s.char_at_reverse(1), 'a');
/// assert_eq!(s.char_at_reverse(2), 'b');
/// ```
- #[unstable(feature = "collections",
- reason = "naming is uncertain with container conventions")]
+ #[unstable(feature = "str_char",
+ reason = "see char_at for more details, but reverse semantics \
+ are also somewhat unclear, especially with which \
+ cases generate panics")]
pub fn char_at_reverse(&self, i: usize) -> char {
core_str::StrExt::char_at_reverse(&self[..], i)
}
/// assert_eq!(c, 'ö');
/// assert_eq!(s2, "we 老虎 Léopard");
/// ```
- #[unstable(feature = "collections",
- reason = "awaiting conventions about shifting and slices")]
+ #[unstable(feature = "str_char",
+ reason = "awaiting conventions about shifting and slices and \
+ may not be warranted with the existence of the chars \
+ and/or char_indices iterators")]
pub fn slice_shift_char(&self) -> Option<(char, &str)> {
core_str::StrExt::slice_shift_char(&self[..])
}
///
/// assert_eq!(gr2.as_slice(), b);
/// ```
- #[unstable(feature = "collections",
+ #[unstable(feature = "unicode",
reason = "this functionality may only be provided by libunicode")]
pub fn graphemes(&self, is_extended: bool) -> Graphemes {
UnicodeStr::graphemes(&self[..], is_extended)
///
/// assert_eq!(gr_inds.as_slice(), b);
/// ```
- #[unstable(feature = "collections",
+ #[unstable(feature = "unicode",
reason = "this functionality may only be provided by libunicode")]
pub fn grapheme_indices(&self, is_extended: bool) -> GraphemeIndices {
UnicodeStr::grapheme_indices(&self[..], is_extended)
/// `true`, else it should be `false`.
/// [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/) recommends that these
/// characters be treated as 1 column (i.e., `is_cjk = false`) if the locale is unknown.
- #[unstable(feature = "collections",
+ #[unstable(feature = "unicode",
reason = "this functionality may only be provided by libunicode")]
pub fn width(&self, is_cjk: bool) -> usize {
UnicodeStr::width(&self[..], is_cjk)