Skip to content

Rust: Naming convention for fields is incorrect [Patch] #32

@AdamLeyshon

Description

@AdamLeyshon

As per Rust RFC430

FIELD_NAMING_CONVENTION should be snake case

From f0e1a04cb88bd7ffcb66b80ddad15f8d6851cb15 Mon Sep 17 00:00:00 2001
From: Adam Leyshon <[email protected]>
Date: Thu, 15 Jul 2021 18:15:01 +0100
Subject: [PATCH] Fix Rust casing

---
 crates/target_rust/src/lib.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crates/target_rust/src/lib.rs b/crates/target_rust/src/lib.rs
index b6215ce..4890e64 100644
--- a/crates/target_rust/src/lib.rs
+++ b/crates/target_rust/src/lib.rs
@@ -19,7 +19,7 @@ lazy_static! {
     static ref FIELD_NAMING_CONVENTION: Box<dyn inflect::Inflector + Send + Sync> =
         Box::new(inflect::KeywordAvoidingInflector::new(
             KEYWORDS.clone(),
-            inflect::TailInflector::new(inflect::Case::camel_case())
+            inflect::TailInflector::new(inflect::Case::snake_case())
         ));
     static ref ENUM_MEMBER_NAMING_CONVENTION: Box<dyn inflect::Inflector + Send + Sync> =
         Box::new(inflect::KeywordAvoidingInflector::new(
-- 
2.30.2.windows.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions