mozilla/rust — pull request #14496 by aochagavia (2014-05-28 19:43:32+00:00)
Title: Changes in Ascii

### Breaking changes:
* Rename `to_byte` to `as_byte`
* Rename `to_char` to `as_char`
* Deprecated `eq_ignore_case` (I don't think we want to have a special function for this when it is so easy to write `a.to_lowercase() == b.to_lowercase()`).

### Other changes (functions copied from char):
* Added `to_digit` function
* Added `is_digit_radix` function
* Added tests for these functions

### Questions (I didn't know where to ask, so I write them here)
* Should we derive `Copy` for `Ascii`? It sounds reasonable since it is just a `u8`.
* Should we remove `to_ascii` (which fails if the character is not ascii) and replace it by `to_ascii_opt`?
* Many of the functions available for `Ascii` are also available for `char`. Maybe we should unify them in a trait. At this moment we have the `Char` trait, but it has some functions specially meant for UTF8 like `is_XID_start` and `is_XID_continue`. Maybe we should split this trait in two: `Char` and `Utf8Char`.
* I think there is some sort of chaos regarding strings of Ascii characters (you have some traits for slices of `&[Ascii]` and `Vec` which offer conversion to normal strings or bytes). I would like to implement an `AsciiString` to bring order to this. Should I just do it and open a PR?

[breaking-change]