• B
    auto merge of #15619 : kwantam/rust/master, r=huonw · 2692ae1d
    bors 提交于
    - `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
    2692ae1d
mod.rs 64.7 KB