diff options
| author | bors <bors@rust-lang.org> | 2014-07-15 22:51:17 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-07-15 22:51:17 +0000 |
| commit | 2692ae1ddde62a3fc01d58220656c5ae32605959 (patch) | |
| tree | 177c501fc844e47263638c7c6b70c4207ede89f0 /src/libstd | |
| parent | de111e69a89c15e77f5f0c49c2f6ab4c25aa89c1 (diff) | |
| parent | cf432b8f8f0d8822e654c1a40bf632f12fc97fbc (diff) | |
| download | rust-2692ae1ddde62a3fc01d58220656c5ae32605959.tar.gz rust-2692ae1ddde62a3fc01d58220656c5ae32605959.zip | |
auto merge of #15619 : kwantam/rust/master, r=huonw
- `width()` computes the displayed width of a string, ignoring the width of control characters.
- arguably we might do *something* else for control characters, but the question is, what?
- users who want to do something else can iterate over chars()
- `graphemes()` returns a `Graphemes` struct, which implements an iterator over the grapheme clusters of a &str.
- fully compliant with [UAX#29](http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)
- passes all [Unicode-supplied tests](http://www.unicode.org/reports/tr41/tr41-15.html#Tests29)
- added code to generate additionial categories in `unicode.py`
- `Cn` aka `Not_Assigned`
- categories necessary for grapheme cluster breaking
- tidied up the exports from libunicode
- all exports are exposed through a module rather than directly at crate root.
- std::prelude imports UnicodeChar and UnicodeStrSlice from std::char and std::str rather than directly from libunicode
closes #7043
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/path/windows.rs | 2 | ||||
| -rw-r--r-- | src/libstd/prelude.rs | 5 | ||||
| -rw-r--r-- | src/libstd/rt/backtrace.rs | 2 |
4 files changed, 5 insertions, 6 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 0df2bb0f57c..c0fddcb2ae5 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -237,7 +237,7 @@ use str::{Str, StrSlice}; use str; use string::String; use uint; -use unicode::UnicodeChar; +use unicode::char::UnicodeChar; use vec::Vec; // Reexports diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index 88ae0d4837e..02d9dc44489 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -24,7 +24,7 @@ use option::{Option, Some, None}; use slice::{Vector, ImmutableVector}; use str::{CharSplits, Str, StrAllocating, StrVector, StrSlice}; use string::String; -use unicode::UnicodeChar; +use unicode::char::UnicodeChar; use vec::Vec; use super::{contains_nul, BytesContainer, GenericPath, GenericPathUnsafe}; diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs index a20ac112ac5..eee494c7bc0 100644 --- a/src/libstd/prelude.rs +++ b/src/libstd/prelude.rs @@ -59,7 +59,7 @@ #[doc(no_inline)] pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr}; #[doc(no_inline)] pub use ascii::IntoBytes; #[doc(no_inline)] pub use c_str::ToCStr; -#[doc(no_inline)] pub use char::Char; +#[doc(no_inline)] pub use char::{Char, UnicodeChar}; #[doc(no_inline)] pub use clone::Clone; #[doc(no_inline)] pub use cmp::{PartialEq, PartialOrd, Eq, Ord}; #[doc(no_inline)] pub use cmp::{Ordering, Less, Equal, Greater, Equiv}; @@ -77,7 +77,7 @@ #[doc(no_inline)] pub use ptr::RawPtr; #[doc(no_inline)] pub use io::{Buffer, Writer, Reader, Seek}; #[doc(no_inline)] pub use str::{Str, StrVector, StrSlice, OwnedStr}; -#[doc(no_inline)] pub use str::{IntoMaybeOwned, StrAllocating}; +#[doc(no_inline)] pub use str::{IntoMaybeOwned, StrAllocating, UnicodeStrSlice}; #[doc(no_inline)] pub use to_str::{ToString, IntoStr}; #[doc(no_inline)] pub use tuple::{Tuple1, Tuple2, Tuple3, Tuple4}; #[doc(no_inline)] pub use tuple::{Tuple5, Tuple6, Tuple7, Tuple8}; @@ -89,7 +89,6 @@ #[doc(no_inline)] pub use slice::{Vector, VectorVector}; #[doc(no_inline)] pub use slice::MutableVectorAllocating; #[doc(no_inline)] pub use string::String; -#[doc(no_inline)] pub use unicode::{UnicodeChar, UnicodeStrSlice}; #[doc(no_inline)] pub use vec::Vec; // Reexported runtime types diff --git a/src/libstd/rt/backtrace.rs b/src/libstd/rt/backtrace.rs index d01a1b5b131..d075f9a1205 100644 --- a/src/libstd/rt/backtrace.rs +++ b/src/libstd/rt/backtrace.rs @@ -21,7 +21,7 @@ use os; use result::{Ok, Err}; use str::StrSlice; use sync::atomics; -use unicode::UnicodeChar; +use unicode::char::UnicodeChar; pub use self::imp::write; |
