This repository was archived by the owner on Oct 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +19
-410
lines changed
Expand file tree Collapse file tree 7 files changed +19
-410
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 11[package ]
22name = " Inflector"
3- version = " 0.11.1 "
3+ version = " 0.11.2 "
44authors = [" Josh Teeter<joshteeter@gmail.com>" ]
55exclude = [" .travis.yml" , " .gitignore" ]
66readme = " README.md"
@@ -27,4 +27,4 @@ name = "inflector"
2727
2828[dependencies ]
2929regex = {version = " 0.2" , optional = true }
30- lazy_static = {version = " 0.2.9 " , optional = true }
30+ lazy_static = {version = " 1.0.0 " , optional = true }
Original file line number Diff line number Diff line change 11#![ deny( warnings) ]
2+ use cases:: case:: * ;
23#[ cfg( feature = "heavyweight" ) ]
34use string:: singularize:: to_singular;
45#[ cfg( feature = "heavyweight" ) ]
@@ -85,7 +86,15 @@ use string::singularize::to_singular;
8586///
8687/// ```
8788pub 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 ) )
You can’t perform that action at this time.
0 commit comments