Skip to content

Support for case conversion helpers.#619

Merged
sunng87 merged 1 commit into
sunng87:masterfrom
gabhijit:case-conversion-helpers
Nov 6, 2023
Merged

Support for case conversion helpers.#619
sunng87 merged 1 commit into
sunng87:masterfrom
gabhijit:case-conversion-helpers

Conversation

@gabhijit

@gabhijit gabhijit commented Nov 6, 2023

Copy link
Copy Markdown
Contributor

Helpers for converting a text string to camelCase, kebab-case, snake_case etc. Supports case conversions from the heck crate. This is an opt-in feature which can be enabled using string_helpers feature.

Helpers for converting a text string to `camelCase`, `kebab-case`,
`snake_case` etc. Supports case conversions from the `heck` crate. This
is an opt-in feature which can be enabled using `string_helpers`
feature.
_rc: &mut crate::render::RenderContext<'_, '_>,
out: &mut dyn crate::output::Output,
) -> crate::helpers::HelperResult {
let param = h.param(0).and_then(|v| v.value().as_str()).unwrap_or("");

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can throw an error for non-string input here?

The error system is slightly different between 4.x and upcoming 5.x so I can do it for you.

@sunng87

sunng87 commented Nov 6, 2023

Copy link
Copy Markdown
Owner

LGTM. I will be cherry-picking this to 4.x branch and update error handling.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 81.207% (+0.1%) from 81.112%
when pulling 1324b99 on gabhijit:case-conversion-helpers
into 94c84a1 on sunng87:master.

@sunng87 sunng87 merged commit ae5e6a5 into sunng87:master Nov 6, 2023
sunng87 pushed a commit that referenced this pull request Nov 6, 2023
Helpers for converting a text string to `camelCase`, `kebab-case`,
`snake_case` etc. Supports case conversions from the `heck` crate. This
is an opt-in feature which can be enabled using `string_helpers`
feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants