Skip to content

Commit

Permalink
Add support for lowercase in rename casing (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephlow authored Jan 10, 2024
1 parent 3fdea32 commit a540c2d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fp-bindgen/src/casing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::convert::TryFrom;
pub enum Casing {
Original,
CamelCase,
LowerCase,
PascalCase,
SnakeCase,
ScreamingSnakeCase,
Expand All @@ -15,6 +16,7 @@ impl Casing {
match self {
Self::Original => None,
Self::CamelCase => Some("camelCase"),
Self::LowerCase => Some("lowercase"),
Self::PascalCase => Some("PascalCase"),
Self::SnakeCase => Some("snake_case"),
Self::ScreamingSnakeCase => Some("SCREAMING_SNAKE_CASE"),
Expand All @@ -25,6 +27,7 @@ impl Casing {
match self {
Self::Original => string.to_owned(),
Self::CamelCase => string.to_camel_case(),
Self::LowerCase => string.to_lowercase(),
Self::PascalCase => string.to_pascal_case(),
Self::SnakeCase => string.to_snake_case(),
Self::ScreamingSnakeCase => string.to_screaming_snake_case(),
Expand All @@ -44,6 +47,7 @@ impl TryFrom<&str> for Casing {
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"camelCase" => Ok(Self::CamelCase),
"lowercase" => Ok(Self::LowerCase),
"PascalCase" => Ok(Self::PascalCase),
"snake_case" => Ok(Self::SnakeCase),
"SCREAMING_SNAKE_CASE" => Ok(Self::ScreamingSnakeCase),
Expand Down

0 comments on commit a540c2d

Please sign in to comment.