Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.

Commit fcd6a44

Browse files
Moved classes case as PascalCase already existed
1 parent 50d7129 commit fcd6a44

File tree

7 files changed

+19
-410
lines changed

7 files changed

+19
-410
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
# 0.11.2
2+
3+
## Non-breaking changes:
4+
- Added class_cases and removed -- Thanks @Yoric
5+
- Use pascal case
6+
- Updated lazy_static to 1.0.0
7+
18
# 0.11.1
29

310
## Non-breaking changes:
411
- Fixed an issue where words ending in e.g. "-ches", such as "witches"; that
512
would be singularized as "wit" instead of the expected "witch". -- Thanks nbaksalyar
6-
7-
## Non-breaking changes:
813
- Will be removing ascii import when current nightly goes stable.
914

1015
# 0.11.0

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "Inflector"
3-
version = "0.11.1"
3+
version = "0.11.2"
44
authors = ["Josh Teeter<joshteeter@gmail.com>"]
55
exclude = [".travis.yml", ".gitignore"]
66
readme = "README.md"
@@ -27,4 +27,4 @@ name = "inflector"
2727

2828
[dependencies]
2929
regex = {version = "0.2", optional = true}
30-
lazy_static = {version = "0.2.9", optional = true}
30+
lazy_static = {version = "1.0.0", optional = true}

src/cases/classcase/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![deny(warnings)]
2+
use cases::case::*;
23
#[cfg(feature = "heavyweight")]
34
use string::singularize::to_singular;
45
#[cfg(feature = "heavyweight")]
@@ -85,7 +86,15 @@ use string::singularize::to_singular;
8586
///
8687
/// ```
8788
pub fn to_class_case(non_class_case_string: &str) -> String {
88-
let class_plural = super::classcases::to_class_cases(non_class_case_string);
89+
let options = CamelOptions {
90+
new_word: true,
91+
last_char: ' ',
92+
first_word: false,
93+
injectable_char: ' ',
94+
has_seperator: false,
95+
inverted: false,
96+
};
97+
let class_plural = to_case_camel_like(non_class_case_string, options);
8998
let split: (&str, &str) =
9099
class_plural.split_at(class_plural.rfind(char::is_uppercase).unwrap_or(0));
91100
format!("{}{}", split.0, to_singular(split.1))

0 commit comments

Comments
 (0)