Skip to content

Titlecase trait #30

@carlocorradini

Description

@carlocorradini

This library is amazing, and it works beautifully.
Currently, the only way to convert a string to title case is using the given function:

let text = "hello world!";
assert_eq!(titlecase(text), "Hello World!");

Even if it works without any issues, it is not really "idiomatic" and is similar to certain JS/CPP/etc... code.
The following code should be our final goal, where the titlecase method is applied directly to the string using the Titlecase trait:

use titlecase::Titlecase;

let text = "hello world!".titlecase();
assert_eq!(text, "Hello World!");

What do you think?
I'll create PR 🙌

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions