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 🙌
This library is amazing, and it works beautifully.
Currently, the only way to convert a string to title case is using the given function:
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
titlecasemethod is applied directly to the string using theTitlecasetrait:What do you think?
I'll create PR 🙌