Skip to content

chore(deps): Update Rust crate convert_case to 0.12.0 - #643

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/convert_case-0.x
Open

chore(deps): Update Rust crate convert_case to 0.12.0#643
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/convert_case-0.x

Conversation

@renovate

@renovate renovate Bot commented Mar 1, 2025

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
convert_case dependencies minor 0.6.00.12.0

Release Notes

rutrum/convert-case (convert_case)

v0.12.0

Compare Source

This release improves speed and memory efficiency. A couple techniques were used:

  • Character case checks first check ascii before doing the more expensive grapheme checks (which require heap allocations).
  • Delimiter only splits get a dedicated path in the split method.
  • The case of characters is computed upfront in a bitmask before checking individual boundary conditions in split. Built-in boundaries get a custom implementation built on top of this bitmask.
Benchmark Before After Improvement
snake_short ("hello_world") 412 ns 21.3 ns −95%
lower_upper ("lowerUpperUpper") 1,631 ns 475 ns −71%
acronym ("XMLRequest") 1,108 ns 418 ns −62%
camel_set ("getTotalLength3D") 3,844 ns 643 ns −83%
defaults_mixed (9 boundaries) 8,083 ns 1,500 ns −81%
defaults_long_snake (265 chars) 52,281 ns 4,730 ns −91%
unicode_cyrillic ("ПЕРСПЕКТИВА24") 8,334 ns 741 ns −91%
Full pipeline from_to_all (4 words x 14 x 14) 1,230 µs 263 µs −79%

v0.11.0

Compare Source

The headline change permits trailing, leading, and duplicate delimiters to persist (default) or be removed. Instead of applying a single pattern, Converter supports multiple patterns and will apply them in order. This comes with another pattern Pattern::RemoveEmpty that drops empty words. This allows for opting into what was default behavior in 0.8.0 and before.

New features:

  • Converter now supports multiple patterns via Converter.patterns: Vec<Pattern>. Patterns are applied in sequence, allowing for composition.
  • Pattern::RemoveEmpty filters 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 adds Pattern::RemoveEmpty to the patterns vector.
"--leading-delims".remove_empty().to_case(Case::Camel)
// "leadingDelims"

Breaking changes:

  • delim_boundary macro is now separator
  • Removed Casing::is_case. Similar functionality is now implemented in convert-case-extras.
  • Instances of delim have been renamed to delimiter:
    • Converter.delim -> Converter.delimiter
    • Converter::set_delim -> Converter::set_delimiter
    • Case::Custom.delim -> Case::Custom.delimiter
    • Case::delim -> Case::delimiter
  • Converter.pattern is now Converter.patterns with type Vec<Pattern>
    • New pattern methods on Converter just like boundaries: set_patterns, add_pattern, add_patterns, remove_pattern, remove_patterns.
    • Pattern::Noop removed. An empty patterns vector represents no mutation.
  • Boundary::Custom and Pattern::Custom variants are no longer comparable.
    • Implementations of PartialEq, Eq, and Hash are no longer derived on Boundary and Pattern, and have been manually implemented.
    • Custom variants always return false for 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 means remove_boundary and remove_pattern will not work for custom variants.
    • Further, all Custom variants now hash to the same value.

Other changes:

  • Much improved documentation: fixed typos, better examples.
  • More comprehensive testing using rstest.

v0.10.0

Compare 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 the convert_case API.

Removed:

  • Case::Toggle and Pattern::Toggle
  • Case::Alternating and Pattern::Alternating
  • Case::Random and Pattern::Random
  • Case::PseudoRandom and Pattern::PseudoRandom
  • random feature is removed. The library no longer has any features.
  • Case::deterministic_cases is removed
  • Case::random_cases is removed

Other breaking changes:

  • Boundary::Custom has lost the arg parameter and Boundary::Custom.condition is more simply fn(&[&str]) -> bool.
    • arg was originally used for building boundaries from delimiters with the Boundary::from_delim function, which is also removed because
    • delim_boundary! macro has replaced Boundary::from_delim functionality, without the need of the arg parameters
  • Casing::with_boundaries is now Casing::set_boundaries and Casing::without_boundaries is now Casing::remove_boundaries to align with Converter

v0.9.0

Compare Source

This release is trying to finalize the API for a 1.0.0 release. In hindsight, making Pattern a function and Boundary a struct were poor decisions. While trying to add customized behavior, I made it harder to use. Luckily, by following the convention that was done with Case in 0.8.0, which was providing a struct-variant Case::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,

  • Change boundaries from constants to enum variants: Boundary::UPPER_SNAKE into Boundary::UpperSnake
  • Change patterns from functions to enum variants on Pattern: pattern::lowercase into Pattern::Lowercase

Most 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

use convert_case::{Case, Casing};
"MyVarName".to_case(Case::Snake);
"my-var name".from_case(Case::Title).to_case(Case::Snake);

You can use the ccase! macro:

use convert_case::ccase;
ccase!(snake, "MyVarName");
ccase!(title -> snake, "my-var name");

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 import Case or Casing. 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)
  • While not intended to be used directly, the new case! macro returns a Case variant from the snake case version of the variant. For instance, case!(snake) is substituted for Case::Snake and case!(upper_flat) for Case::UpperFlat.

Other breaking changes:

  • Leading, trailing, and duplicate delimiters are no longer removed and are returned as is.
  • Boundary is reverted back to being an enum, but with a Custom variant that gives all the same flexibility that Boundary had as a struct. This aligns with the Case::Custom pattern.
    • Boundary.match will return true if a set of graphemes matches the boundary condition
    • Boundary methods for start and len describe how enum variants consume letters when matched
  • Pattern is reverted back to being an enum, but with a Custom variant that allowed you to pass your own fn (&[&str]) -> Vec<String> as input.
    • Pattern.mutate will perform the associated mutation function
  • Converter.with_boundaries has been renamed to Converter.set_boundaries.
  • Removed Converter.remove_delim and Converter.remove_pattern. You can use set_delim("") and set_pattern(Pattern::Noop) instead.
  • ToString is no longer a required trait for using is_case
  • word_pattern module has been removed

v0.8.0

Compare 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 the pattern module. For upgrading this means changing Pattern::Lowercase to pattern::lowercase, and calling the function directly instead of invoking the mutate method on the enum.

Inside the pattern module is also the type alias Pattern itself.

Other breaking changes:

  • Add Case::Ada (capital pattern with underscore delimiter.)
  • Add Case::Custom variant. It is a struct variant that takes three parameters:
    • pattern with type Pattern
    • delim with type &static str, and
    • boundaries with type &'static [Boundary].
  • Because of the new pattern::noop function, Converter attribute pattern is now of type Pattern and not Option<Pattern>
  • Case::deterministic_cases, Case::all_cases, and Case::random_cases now return static arrays instead of vecs

Other changes:

  • Added Case::split, Case::mutate, and Case::join which expose operations related to the boundaries, pattern, and delimiter of a case
  • Is now no_std compatible

v0.7.1

Compare Source

  • Removed debug print statement.

v0.7.0

Compare 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::LowerUpper to just Boundary::LOWER_UPPER.

The benefit of this is that you can make your boundary conditions now, by instantiating the Boundary struct, or using Boundary::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:

  • Previous Boundary::PascalName enum variants now much referred to as Boundary::CONSTANT_NAME constants.
  • All functions that returned groups of boundaries (such as Boundary::defaults(), Boundary::digit_letter(), etc) now are const and return fixed-sized arrays [Boundary; N], not Vec<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 to Boundary::defaults_from() and no longer outputs Boundary::UPPER_LOWER, since this function now only checks default boundaries.
  • Create custom delimiter boundaries using Boundary::from_delim().

Other breaking changes:

  • Rename Case::ScreamingSnake to Case::Constant.
  • Add Case::Sentence (sentence pattern and space delimiter.)
  • Casing trait implemented for Arc<str> and Rc<str> again.

Other changes:

  • Remove most imports from doc comments.
  • Remove loop over str::chars in favor of graphemes from unicode-segmentation.

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • "before 5am on the first day of the month"
  • Automerge
    • At any time (no schedule defined)

🚦 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from 9e09cc3 to 1ef450b Compare July 8, 2025 20:55
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from 1ef450b to 7058999 Compare August 10, 2025 13:43
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from 7058999 to a1c1c9a Compare September 24, 2025 16:02
@renovate renovate Bot changed the title chore(deps): Update Rust crate convert_case to 0.8 chore(deps): Update Rust crate convert_case to 0.8.0 Sep 24, 2025
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from a1c1c9a to 9c1206f Compare September 25, 2025 16:54
@renovate renovate Bot changed the title chore(deps): Update Rust crate convert_case to 0.8.0 chore(deps): Update Rust crate convert_case to 0.9.0 Nov 6, 2025
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from 9c1206f to e3ddb07 Compare November 6, 2025 17:48
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from e3ddb07 to 192f24b Compare November 23, 2025 13:05
@renovate renovate Bot changed the title chore(deps): Update Rust crate convert_case to 0.9.0 chore(deps): Update Rust crate convert_case to 0.10.0 Nov 23, 2025
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from 192f24b to 0d09429 Compare December 10, 2025 10:39
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from 0d09429 to b68e10c Compare December 31, 2025 13:46
@vsiles

vsiles commented Jan 17, 2026

Copy link
Copy Markdown

It seems that fixing the compilation is just a matter of replacing Case with Case<'static>.
The alternative is to make this crate's definitions generic.

Which solution would you prefer. I can prepare a PR once the choice is done.

@epage

epage commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

convert_case shows up in our public API so by upgrading, we make a breaking change and are waiting on this until we are ready to make a breaking change

@vsiles

vsiles commented Jan 19, 2026

Copy link
Copy Markdown

I see, thanks for the info. Do you have any ETA in mind or is nothing breaking planned at the moment ?

@epage

epage commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

Not at the moment. Is there a reason you are interested in the new convert_case?

@vsiles

vsiles commented Jan 19, 2026

Copy link
Copy Markdown

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 config too. We can keep the old version for now. Just curious ;)

@renovate renovate Bot changed the title chore(deps): Update Rust crate convert_case to 0.10.0 chore(deps): Update Rust crate convert_case to 0.11.0 Jan 31, 2026
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch 2 times, most recently from 8ee604a to 99e929a Compare February 2, 2026 21:31
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from 99e929a to a3a3595 Compare February 12, 2026 14:10
@alerque

alerque commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

I have a project that uses convert_case directly as well as config and having both an old version and a new one in the SBOM is rather a pain. Just to add to the insult I'm also using rig and that has dependencies pinned at 0.8, so that is THREE versions. Obviously that last one is not config’s fault ;-)

At some pain of not having a breaking release starts adding up to offset the pain of breaking releases.

@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch 2 times, most recently from 49486e4 to 1515463 Compare March 13, 2026 11:47
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from 1515463 to 8792812 Compare May 18, 2026 10:14
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from 8792812 to 3f8e26d Compare July 20, 2026 21:31
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from 3f8e26d to db4dd1f Compare August 11, 2026 21:52
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from db4dd1f to e86ab94 Compare August 26, 2026 15:35
@renovate
renovate Bot force-pushed the renovate/convert_case-0.x branch from e86ab94 to 18fa96d Compare August 27, 2026 12:12
@renovate renovate Bot changed the title chore(deps): Update Rust crate convert_case to 0.11.0 chore(deps): Update Rust crate convert_case to 0.12.0 Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants