chore(deps): Update Rust crate convert_case to 0.12.0 - #643
Conversation
9e09cc3 to
1ef450b
Compare
1ef450b to
7058999
Compare
7058999 to
a1c1c9a
Compare
a1c1c9a to
9c1206f
Compare
9c1206f to
e3ddb07
Compare
e3ddb07 to
192f24b
Compare
192f24b to
0d09429
Compare
0d09429 to
b68e10c
Compare
|
It seems that fixing the compilation is just a matter of replacing Which solution would you prefer. I can prepare a PR once the choice is done. |
|
|
|
I see, thanks for the info. Do you have any ETA in mind or is nothing breaking planned at the moment ? |
|
Not at the moment. Is there a reason you are interested in the new |
|
Nothing technical: running renovate on our projects showed we were a few version behind so I tried to catch up and saw the dependency from |
8ee604a to
99e929a
Compare
99e929a to
a3a3595
Compare
|
I have a project that uses At some pain of not having a breaking release starts adding up to offset the pain of breaking releases. |
49486e4 to
1515463
Compare
1515463 to
8792812
Compare
8792812 to
3f8e26d
Compare
3f8e26d to
db4dd1f
Compare
db4dd1f to
e86ab94
Compare
e86ab94 to
18fa96d
Compare
This PR contains the following updates:
0.6.0→0.12.0Release Notes
rutrum/convert-case (convert_case)
v0.12.0Compare Source
This release improves speed and memory efficiency. A couple techniques were used:
splitmethod.split. Built-in boundaries get a custom implementation built on top of this bitmask.snake_short("hello_world")lower_upper("lowerUpperUpper")acronym("XMLRequest")camel_set("getTotalLength3D")defaults_mixed(9 boundaries)defaults_long_snake(265 chars)unicode_cyrillic("ПЕРСПЕКТИВА24")from_to_all(4 words x 14 x 14)v0.11.0Compare Source
The headline change permits trailing, leading, and duplicate delimiters to persist (default) or be removed. Instead of applying a single pattern,
Convertersupports multiple patterns and will apply them in order. This comes with another patternPattern::RemoveEmptythat drops empty words. This allows for opting into what was default behavior in 0.8.0 and before.New features:
Converternow supports multiple patterns viaConverter.patterns: Vec<Pattern>. Patterns are applied in sequence, allowing for composition.Pattern::RemoveEmptyfilters out empty words. This is useful when splitting produces empty words from leading, trailing, or duplicate delimiters (e.g.,"--a--b"split on hyphens).Casing::remove_empty()is a convenience method that addsPattern::RemoveEmptyto thepatternsvector.Breaking changes:
delim_boundarymacro is nowseparatorCasing::is_case. Similar functionality is now implemented inconvert-case-extras.delimhave been renamed todelimiter:Converter.delim->Converter.delimiterConverter::set_delim->Converter::set_delimiterCase::Custom.delim->Case::Custom.delimiterCase::delim->Case::delimiterConverter.patternis nowConverter.patternswith typeVec<Pattern>Converterjust like boundaries:set_patterns,add_pattern,add_patterns,remove_pattern,remove_patterns.Pattern::Noopremoved. An empty patterns vector represents no mutation.Boundary::CustomandPattern::Customvariants are no longer comparable.PartialEq,Eq, andHashare no longer derived onBoundaryandPattern, and have been manually implemented.falsefor equality checks because function pointers cannot be reliably compared. This has been true for all of rust, but the compiler warning is relatively new to the author. This meansremove_boundaryandremove_patternwill not work for custom variants.Customvariants now hash to the same value.Other changes:
rstest.v0.10.0Compare Source
Since the library is so extensible with its new API, there is no longer a need for some niche or fun transformations to be made available in this library. Some of the features that are removed are now in a new library
convert_case_extras. That library will have a lower threshold on what is included (i.e. more features), and will also serve as a demonstration of what's capable with theconvert_caseAPI.Removed:
Case::ToggleandPattern::ToggleCase::AlternatingandPattern::AlternatingCase::RandomandPattern::RandomCase::PseudoRandomandPattern::PseudoRandomrandomfeature is removed. The library no longer has any features.Case::deterministic_casesis removedCase::random_casesis removedOther breaking changes:
Boundary::Customhas lost theargparameter andBoundary::Custom.conditionis more simplyfn(&[&str]) -> bool.argwas originally used for building boundaries from delimiters with theBoundary::from_delimfunction, which is also removed becausedelim_boundary!macro has replacedBoundary::from_delimfunctionality, without the need of theargparametersCasing::with_boundariesis nowCasing::set_boundariesandCasing::without_boundariesis nowCasing::remove_boundariesto align withConverterv0.9.0Compare Source
This release is trying to finalize the API for a 1.0.0 release. In hindsight, making
Patterna function andBoundarya struct were poor decisions. While trying to add customized behavior, I made it harder to use. Luckily, by following the convention that was done withCasein 0.8.0, which was providing a struct-variantCase::Custom, I can keep the new customization options while reverting back to the enum pattern the library has had since the beginning.If you are updating from before 0.7.0, I don't think any changes are necessary. If you're coming from 0.7.0 or higher,
Boundary::UPPER_SNAKEintoBoundary::UpperSnakePattern:pattern::lowercaseintoPattern::LowercaseMost excitingly, I've introduced a brand new way to use the crate for 99% of use cases, which is the default behavior out of the box to just convert a string to a case, with no modifications to behavior. Instead of
You can use the
ccase!macro:This means only one import and its invocation is brief and easy to read. This is now the first thing you see when viewing the docs, which themselves have gotten a huge overhaul and many improvements in this version.
New features:
ccase!macro that performs case conversion on a string without needing to importCaseorCasing. It has two forms:ccase!(snake, "string")is equivalent to"string".to_case(Case::Snake)ccase!(kebab -> snake, "string")is equivalent to"string".from_case(Case::Kebab).to_case(Case::Snake)case!macro returns aCasevariant from the snake case version of the variant. For instance,case!(snake)is substituted forCase::Snakeandcase!(upper_flat)forCase::UpperFlat.Other breaking changes:
Boundaryis reverted back to being an enum, but with aCustomvariant that gives all the same flexibility thatBoundaryhad as a struct. This aligns with theCase::Custompattern.Boundary.matchwill return true if a set of graphemes matches the boundary conditionBoundarymethods forstartandlendescribe how enum variants consume letters when matchedPatternis reverted back to being an enum, but with aCustomvariant that allowed you to pass your ownfn (&[&str]) -> Vec<String>as input.Pattern.mutatewill perform the associated mutation functionConverter.with_boundarieshas been renamed toConverter.set_boundaries.Converter.remove_delimandConverter.remove_pattern. You can useset_delim("")andset_pattern(Pattern::Noop)instead.ToStringis no longer a required trait for usingis_caseword_patternmodule has been removedv0.8.0Compare Source
Pattern is no longer an enum. It is now a type alias for
fn(&[&str]) -> Vec<String>. The variants of Pattern can now be referenced as functions inside thepatternmodule. For upgrading this means changingPattern::Lowercasetopattern::lowercase, and calling the function directly instead of invoking themutatemethod on the enum.Inside the pattern module is also the type alias
Patternitself.Other breaking changes:
Case::Ada(capital pattern with underscore delimiter.)Case::Customvariant. It is a struct variant that takes three parameters:Pattern&static str, and&'static [Boundary].pattern::noopfunction,Converterattributepatternis now of typePatternand notOption<Pattern>Case::deterministic_cases,Case::all_cases, andCase::random_casesnow return static arrays instead of vecsOther changes:
Case::split,Case::mutate, andCase::joinwhich expose operations related to the boundaries, pattern, and delimiter of a caseno_stdcompatiblev0.7.1Compare Source
v0.7.0Compare Source
Boundary is no longer an enum. It now is a struct, and each enum variant corresponds to an associated constant. For upgrading this just means changing
Boundary::LowerUpperto justBoundary::LOWER_UPPER.The benefit of this is that you can make your boundary conditions now, by instantiating the
Boundarystruct, or usingBoundary::from_delim(). Now you can split on newlines, periods, double-colons, emojis, or a more complex case like a symbol followed by a digit. You also define which characters, if any, are removed during segmentation, and where the split happens.Changes from this feature:
Boundary::PascalNameenum variants now much referred to asBoundary::CONSTANT_NAMEconstants.Boundary::defaults(),Boundary::digit_letter(), etc) now are const and return fixed-sized arrays[Boundary; N], notVec<Boundary>.Boundary::all()was removed, since there's no longer a sense of "all" boundaries, since you can create your own.Boundary::list_from()has been renamed toBoundary::defaults_from()and no longer outputsBoundary::UPPER_LOWER, since this function now only checks default boundaries.Boundary::from_delim().Other breaking changes:
Case::ScreamingSnaketoCase::Constant.Case::Sentence(sentence pattern and space delimiter.)Casingtrait implemented forArc<str>andRc<str>again.Other changes:
str::charsin favor ofgraphemesfromunicode-segmentation.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.