Make ascii_* sets private to characters

This commit is contained in:
Eryn Wells 2016-12-20 17:51:43 -08:00
parent 7c43e93470
commit 08bbaeb7cf
2 changed files with 3 additions and 3 deletions

View file

@ -7,12 +7,12 @@ use std::iter::FromIterator;
pub type CharSet = HashSet<char>;
pub fn ascii_letters() -> CharSet {
fn ascii_letters() -> CharSet {
let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".chars();
CharSet::from_iter(letters)
}
pub fn ascii_digits() -> CharSet {
fn ascii_digits() -> CharSet {
let digits = "1234567890".chars();
CharSet::from_iter(digits)
}

View file

@ -31,6 +31,6 @@ impl Iterator for Lexer {
pub fn hello(person: &str) {
println!("Hello, {}!", person);
for (idx, c) in person.char_indices() {
println!(" {}, {} -> {}", c, idx, characters::ascii_letters().contains(&c));
println!(" {}, {} -> {}", c, idx, characters::identifier_initials().contains(&c));
}
}