#identifier

ident_case

Utility for applying case rules to Rust identifiers

2 stable releases

Uses old Rust 2015

1.0.1 Mar 18, 2019
1.0.0 May 10, 2017

#24 in #identifier

Download history 1163296/week @ 2024-07-20 1148203/week @ 2024-07-27 1165015/week @ 2024-08-03 1205816/week @ 2024-08-10 1221828/week @ 2024-08-17 1222402/week @ 2024-08-24 1162180/week @ 2024-08-31 1251183/week @ 2024-09-07 1175470/week @ 2024-09-14 1434772/week @ 2024-09-21 1448301/week @ 2024-09-28 1943521/week @ 2024-10-05 1841574/week @ 2024-10-12 1948102/week @ 2024-10-19 1435885/week @ 2024-10-26 1418927/week @ 2024-11-02

6,878,164 downloads per month
Used in 8,444 crates (16 directly)

MIT/Apache

9KB
122 lines

Build Status

Crate for manipulating case of identifiers in Rust programs.

Features

  • Supports snake_case, lowercase, camelCase, PascalCase, SCREAMING_SNAKE_CASE, and kebab-case
  • Rename variants, and fields

Examples

assert_eq!("helloWorld", RenameRule::CamelCase.apply_to_field("hello_world"));

assert_eq!("i_love_serde", RenameRule::SnakeCase.apply_to_variant("ILoveSerde"));

lib.rs:

Crate for changing case of Rust identifiers.

Features

  • Supports snake_case, lowercase, camelCase, PascalCase, SCREAMING_SNAKE_CASE, and kebab-case
  • Rename variants, and fields

Examples

use ident_case::RenameRule;

assert_eq!("helloWorld", RenameRule::CamelCase.apply_to_field("hello_world"));

assert_eq!("i_love_serde", RenameRule::SnakeCase.apply_to_variant("ILoveSerde"));

No runtime deps