Skip to content

Commit

Permalink
Clarify README example a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Jan 23, 2015
1 parent 8683be2 commit e6bd713
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions README.md
Expand Up @@ -26,12 +26,21 @@ Example
extern crate phf_mac;
extern crate phf;

#[derive(Clone)]
pub enum Keyword {
Loop,
Continue,
Break,
Fn,
Extern,
}

static KEYWORDS: phf::Map<&'static str, Keyword> = phf_map! {
"loop" => LOOP,
"continue" => CONTINUE,
"break" => BREAK,
"fn" => FN,
"extern" => EXTERN,
"loop" => Keyword::Loop,
"continue" => Keyword::Continue,
"break" => Keyword::Break,
"fn" => Keyword::Fn,
"extern" => Keyword::Extern,
};

pub fn parse_keyword(keyword: &str) -> Option<Keyword> {
Expand Down

0 comments on commit e6bd713

Please sign in to comment.