cg2 0.1.0

Rust code generator.
Documentation
#[derive(Debug, Clone, Copy)]
pub enum Keyword {
  Pub,
  Unsafe,
  Fn,
  Mut,
  If,
  Else,
  Enum,
  Impl,
  Struct,
  Union,
  Let,
  Const,
  Self_,
  SelfTy,
}

impl Keyword {
  #[must_use]
  pub const fn as_str(&self) -> &str {
    use Keyword::*;
    match self {
      Pub => "pub",
      Unsafe => "unsafe",
      Fn => "fn",
      Mut => "mut",
      If => "if",
      Else => "else",
      Enum => "enum",
      Impl => "impl",
      Struct => "struct",
      Union => "union",
      Let => "let",
      Const => "const",
      Self_ => "self",
      SelfTy => "Self",
    }
  }
}