convert-case icon indicating copy to clipboard operation
convert-case copied to clipboard

Add without_boundaries to Casing trait

Open duskmoon314 opened this issue 1 year ago • 1 comments

Intro

Add without_boundaries to the Casing trait to allow the below usage:

"2dTransFormation".without_boundaries(&Boundary::digits()).to_case(Case::Snake)

Motivation

There is a with_boundaries method in both Casing and StateConverter. But we can only use without_boundaries with StateConverter. It is convenient to have without_boundaries in Casing.

Worry

  • Haven't fully tested this. Though the code in the doc seems working well.
  • Adding a method to the Casing trait is a breaking change. (IMO)

duskmoon314 avatar Jul 08 '22 12:07 duskmoon314

I have used and it seems to work well.

@rutrum Would you please review this? I think it is useful when want to convert the case of str without several boundaries.

duskmoon314 avatar Jul 10 '22 08:07 duskmoon314