While working on a pangram exercise, I found that there are some improvements that would be useful in AsciiExt. Also, I’m thinking about a first probable way to contribute to the language so any guidance you can give me will be great.
So, coming with a Python background, dealing with ascii usually involves using some constants present in the string module. For example string.ascii_letters, string.ascii_lowercase or string.punctuation.
Even while some of this constants have equivalents in std::ascii, some additional constants and functions would make it easier to deal with ASCII. For example, for the pangram example, I implemented a custom trait:
trait MyAsciiExt {
fn is_ascii_letter(&self) -> bool;
}
impl MyAsciiExt for char {
fn is_ascii_letter(&self) -> bool {
match *self as u32 {
65...90 => true,
97...122 => true,
_ => false
}
}
}
Additional methods would be implemented as is_ascii_punctuation or is_ascii_whitespace.
Does this makes sense at all? Would this be something you could consider as an useful improvement for std::ascii?