@@ -26,9 +26,7 @@ use std::fmt::{Display, Formatter};
2626use std:: path:: Path ;
2727use std:: sync:: OnceLock ;
2828
29- use convert_case:: pattern:: Pattern ;
30- use convert_case:: Converter ;
31- use convert_case:: { pattern, Boundary } ;
29+ use convert_case:: { Boundary , Converter , Pattern } ;
3230use dirs:: home_dir;
3331use globset:: { Glob , GlobSet , GlobSetBuilder } ;
3432use serde:: { Deserialize , Serialize } ;
@@ -373,57 +371,57 @@ impl CaseConvention {
373371 // For all case converters, we do not consider digits
374372 // as boundaries.
375373 Converter :: new ( )
376- . remove_boundary ( Boundary :: DIGIT_LOWER )
377- . remove_boundary ( Boundary :: DIGIT_UPPER )
378- . remove_boundary ( Boundary :: UPPER_DIGIT )
379- . remove_boundary ( Boundary :: LOWER_DIGIT )
374+ . remove_boundary ( Boundary :: DigitLower )
375+ . remove_boundary ( Boundary :: DigitUpper )
376+ . remove_boundary ( Boundary :: UpperDigit )
377+ . remove_boundary ( Boundary :: LowerDigit )
380378 . set_pattern ( pattern)
381- . set_delim ( delim)
379+ . set_delimiter ( delim)
382380 }
383381
384382 let text = text. replace ( '.' , "_" ) ;
385383 match self {
386384 CaseConvention :: LowerCase => LOWER_CASE
387385 . get_or_init ( || {
388- new_converter ( pattern :: lowercase , " " ) . add_boundary ( Boundary :: SPACE )
386+ new_converter ( Pattern :: Lowercase , " " ) . add_boundary ( Boundary :: Space )
389387 } )
390388 . convert ( & text) ,
391389 CaseConvention :: UpperCase => UPPER_CASE
392390 . get_or_init ( || {
393- new_converter ( pattern :: uppercase , " " ) . add_boundary ( Boundary :: SPACE )
391+ new_converter ( Pattern :: Uppercase , " " ) . add_boundary ( Boundary :: Space )
394392 } )
395393 . convert ( & text) ,
396394 CaseConvention :: TitleCase => TITLE_CASE
397- . get_or_init ( || new_converter ( pattern :: capital , " " ) . add_boundary ( Boundary :: SPACE ) )
395+ . get_or_init ( || new_converter ( Pattern :: Capital , " " ) . add_boundary ( Boundary :: Space ) )
398396 . convert ( & text) ,
399397 CaseConvention :: PascalCase => PASCAL_CASE
400398 . get_or_init ( || {
401- new_converter ( pattern :: capital , "" ) . add_boundary ( Boundary :: LOWER_UPPER )
399+ new_converter ( Pattern :: Capital , "" ) . add_boundary ( Boundary :: LowerUpper )
402400 } )
403401 . convert ( & text) ,
404402 CaseConvention :: CamelCase => CAMEL_CASE
405403 . get_or_init ( || {
406- new_converter ( pattern :: camel , "" ) . add_boundary ( Boundary :: LOWER_UPPER )
404+ new_converter ( Pattern :: Camel , "" ) . add_boundary ( Boundary :: LowerUpper )
407405 } )
408406 . convert ( & text) ,
409407 CaseConvention :: SnakeCase => SNAKE_CASE
410408 . get_or_init ( || {
411- new_converter ( pattern :: lowercase , "_" ) . add_boundary ( Boundary :: UNDERSCORE )
409+ new_converter ( Pattern :: Lowercase , "_" ) . add_boundary ( Boundary :: Underscore )
412410 } )
413411 . convert ( & text) ,
414412 CaseConvention :: ScreamingSnakeCase => SCREAMING_SNAKE_CASE
415413 . get_or_init ( || {
416- new_converter ( pattern :: uppercase , "_" ) . add_boundary ( Boundary :: UNDERSCORE )
414+ new_converter ( Pattern :: Uppercase , "_" ) . add_boundary ( Boundary :: Underscore )
417415 } )
418416 . convert ( & text) ,
419417 CaseConvention :: KebabCase => KEBAB_CASE
420418 . get_or_init ( || {
421- new_converter ( pattern :: lowercase , "-" ) . add_boundary ( Boundary :: HYPHEN )
419+ new_converter ( Pattern :: Lowercase , "-" ) . add_boundary ( Boundary :: Hyphen )
422420 } )
423421 . convert ( & text) ,
424422 CaseConvention :: ScreamingKebabCase => SCREAMING_KEBAB_CASE
425423 . get_or_init ( || {
426- new_converter ( pattern :: uppercase , "-" ) . add_boundary ( Boundary :: HYPHEN )
424+ new_converter ( Pattern :: Uppercase , "-" ) . add_boundary ( Boundary :: Hyphen )
427425 } )
428426 . convert ( & text) ,
429427 }
0 commit comments