@@ -59,13 +59,13 @@ use core::result::Result;
59
59
use core:: str as core_str;
60
60
use core:: str:: pattern:: Pattern ;
61
61
use core:: str:: pattern:: { Searcher , ReverseSearcher , DoubleEndedSearcher } ;
62
- use unicode :: str:: { UnicodeStr , Utf16Encoder } ;
62
+ use rustc_unicode :: str:: { UnicodeStr , Utf16Encoder } ;
63
63
64
64
use core:: convert:: AsRef ;
65
65
use vec_deque:: VecDeque ;
66
66
use borrow:: { Borrow , ToOwned } ;
67
67
use string:: String ;
68
- use unicode ;
68
+ use rustc_unicode ;
69
69
use vec:: Vec ;
70
70
use slice:: SliceConcatExt ;
71
71
@@ -78,7 +78,7 @@ pub use core::str::{Matches, RMatches};
78
78
pub use core:: str:: { MatchIndices , RMatchIndices } ;
79
79
pub use core:: str:: { from_utf8, Chars , CharIndices , Bytes } ;
80
80
pub use core:: str:: { from_utf8_unchecked, ParseBoolError } ;
81
- pub use unicode :: str:: { Words , Graphemes , GraphemeIndices } ;
81
+ pub use rustc_unicode :: str:: { Words , Graphemes , GraphemeIndices } ;
82
82
pub use core:: str:: pattern;
83
83
84
84
/*
@@ -161,6 +161,9 @@ enum DecompositionType {
161
161
/// External iterator for a string decomposition's characters.
162
162
///
163
163
/// For use with the `std::iter` module.
164
+ #[ allow( deprecated) ]
165
+ #[ deprecated( reason = "use the crates.io `unicode-normalization` library instead" ,
166
+ since = "1.0.0" ) ]
164
167
#[ derive( Clone ) ]
165
168
#[ unstable( feature = "unicode" ,
166
169
reason = "this functionality may be replaced with a more generic \
@@ -172,6 +175,7 @@ pub struct Decompositions<'a> {
172
175
sorted : bool
173
176
}
174
177
178
+ #[ allow( deprecated) ]
175
179
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
176
180
impl < ' a > Iterator for Decompositions < ' a > {
177
181
type Item = char ;
@@ -198,7 +202,7 @@ impl<'a> Iterator for Decompositions<'a> {
198
202
{
199
203
let callback = |d| {
200
204
let class =
201
- unicode :: char:: canonical_combining_class ( d) ;
205
+ rustc_unicode :: char:: canonical_combining_class ( d) ;
202
206
if class == 0 && !* sorted {
203
207
canonical_sort ( buffer) ;
204
208
* sorted = true ;
@@ -207,10 +211,10 @@ impl<'a> Iterator for Decompositions<'a> {
207
211
} ;
208
212
match self . kind {
209
213
Canonical => {
210
- unicode :: char:: decompose_canonical ( ch, callback)
214
+ rustc_unicode :: char:: decompose_canonical ( ch, callback)
211
215
}
212
216
Compatible => {
213
- unicode :: char:: decompose_compatible ( ch, callback)
217
+ rustc_unicode :: char:: decompose_compatible ( ch, callback)
214
218
}
215
219
}
216
220
}
@@ -254,6 +258,9 @@ enum RecompositionState {
254
258
/// External iterator for a string recomposition's characters.
255
259
///
256
260
/// For use with the `std::iter` module.
261
+ #[ allow( deprecated) ]
262
+ #[ deprecated( reason = "use the crates.io `unicode-normalization` library instead" ,
263
+ since = "1.0.0" ) ]
257
264
#[ derive( Clone ) ]
258
265
#[ unstable( feature = "unicode" ,
259
266
reason = "this functionality may be replaced with a more generic \
@@ -266,6 +273,7 @@ pub struct Recompositions<'a> {
266
273
last_ccc : Option < u8 >
267
274
}
268
275
276
+ #[ allow( deprecated) ]
269
277
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
270
278
impl < ' a > Iterator for Recompositions < ' a > {
271
279
type Item = char ;
@@ -276,7 +284,7 @@ impl<'a> Iterator for Recompositions<'a> {
276
284
match self . state {
277
285
Composing => {
278
286
for ch in self . iter . by_ref ( ) {
279
- let ch_class = unicode :: char:: canonical_combining_class ( ch) ;
287
+ let ch_class = rustc_unicode :: char:: canonical_combining_class ( ch) ;
280
288
if self . composee . is_none ( ) {
281
289
if ch_class != 0 {
282
290
return Some ( ch) ;
@@ -288,7 +296,7 @@ impl<'a> Iterator for Recompositions<'a> {
288
296
289
297
match self . last_ccc {
290
298
None => {
291
- match unicode :: char:: compose ( k, ch) {
299
+ match rustc_unicode :: char:: compose ( k, ch) {
292
300
Some ( r) => {
293
301
self . composee = Some ( r) ;
294
302
continue ;
@@ -316,7 +324,7 @@ impl<'a> Iterator for Recompositions<'a> {
316
324
self . last_ccc = Some ( ch_class) ;
317
325
continue ;
318
326
}
319
- match unicode :: char:: compose ( k, ch) {
327
+ match rustc_unicode :: char:: compose ( k, ch) {
320
328
Some ( r) => {
321
329
self . composee = Some ( r) ;
322
330
continue ;
@@ -465,6 +473,9 @@ impl str {
465
473
466
474
/// Returns an iterator over the string in Unicode Normalization Form D
467
475
/// (canonical decomposition).
476
+ #[ allow( deprecated) ]
477
+ #[ deprecated( reason = "use the crates.io `unicode-normalization` library instead" ,
478
+ since = "1.0.0" ) ]
468
479
#[ inline]
469
480
#[ unstable( feature = "unicode" ,
470
481
reason = "this functionality may be replaced with a more generic \
@@ -480,6 +491,9 @@ impl str {
480
491
481
492
/// Returns an iterator over the string in Unicode Normalization Form KD
482
493
/// (compatibility decomposition).
494
+ #[ allow( deprecated) ]
495
+ #[ deprecated( reason = "use the crates.io `unicode-normalization` library instead" ,
496
+ since = "1.0.0" ) ]
483
497
#[ inline]
484
498
#[ unstable( feature = "unicode" ,
485
499
reason = "this functionality may be replaced with a more generic \
@@ -495,6 +509,9 @@ impl str {
495
509
496
510
/// An Iterator over the string in Unicode Normalization Form C
497
511
/// (canonical decomposition followed by canonical composition).
512
+ #[ allow( deprecated) ]
513
+ #[ deprecated( reason = "use the crates.io `unicode-normalization` library instead" ,
514
+ since = "1.0.0" ) ]
498
515
#[ inline]
499
516
#[ unstable( feature = "unicode" ,
500
517
reason = "this functionality may be replaced with a more generic \
@@ -511,6 +528,9 @@ impl str {
511
528
512
529
/// An Iterator over the string in Unicode Normalization Form KC
513
530
/// (compatibility decomposition followed by canonical composition).
531
+ #[ allow( deprecated) ]
532
+ #[ deprecated( reason = "use the crates.io `unicode-normalization` library instead" ,
533
+ since = "1.0.0" ) ]
514
534
#[ inline]
515
535
#[ unstable( feature = "unicode" ,
516
536
reason = "this functionality may be replaced with a more generic \
@@ -1690,6 +1710,8 @@ impl str {
1690
1710
///
1691
1711
/// assert_eq!(&gr2[..], b);
1692
1712
/// ```
1713
+ #[ deprecated( reason = "use the crates.io `unicode-segmentation` library instead" ,
1714
+ since = "1.0.0" ) ]
1693
1715
#[ unstable( feature = "unicode" ,
1694
1716
reason = "this functionality may only be provided by libunicode" ) ]
1695
1717
pub fn graphemes ( & self , is_extended : bool ) -> Graphemes {
@@ -1709,6 +1731,8 @@ impl str {
1709
1731
///
1710
1732
/// assert_eq!(&gr_inds[..], b);
1711
1733
/// ```
1734
+ #[ deprecated( reason = "use the crates.io `unicode-segmentation` library instead" ,
1735
+ since = "1.0.0" ) ]
1712
1736
#[ unstable( feature = "unicode" ,
1713
1737
reason = "this functionality may only be provided by libunicode" ) ]
1714
1738
pub fn grapheme_indices ( & self , is_extended : bool ) -> GraphemeIndices {
@@ -1749,6 +1773,8 @@ impl str {
1749
1773
/// recommends that these
1750
1774
/// characters be treated as 1 column (i.e., `is_cjk = false`) if the
1751
1775
/// locale is unknown.
1776
+ #[ deprecated( reason = "use the crates.io `unicode-width` library instead" ,
1777
+ since = "1.0.0" ) ]
1752
1778
#[ unstable( feature = "unicode" ,
1753
1779
reason = "this functionality may only be provided by libunicode" ) ]
1754
1780
pub fn width ( & self , is_cjk : bool ) -> usize {
0 commit comments