5 releases
new 0.1.2 | Jan 6, 2025 |
---|---|
0.1.1 | Jan 6, 2025 |
0.1.0 | Jan 6, 2025 |
0.0.2 | Dec 21, 2024 |
0.0.1 | Dec 20, 2024 |
#889 in Rust patterns
507 downloads per month
17KB
459 lines
fluent-string
Fluent versions of String mutation methods
Also some useful combinators related to conditional pushing.
Release
0.0.1 - initial version 0.0.2 - initial complete version 0.1.0 - rename the main trait to FluentString (a more general name isn't really useful) 0.1.1 - add conditional push combinators 0.1.2 - enhance push combinators to pass the source reference as well as the self reference
lib.rs
:
A trait that provides fluent versions of String
mutation
methods, allowing for a fluent construction of strings.
It also implements two conditional push combinators
f_push_if
and f_push_str_if
to help with such things
as comma-separated token construction.
Examples
use fluent_string::*;
assert_eq!("my string".to_owned()
.f_push_str(" is a bit longer now")
.f_insert_str(12,", maybe,")
.f_truncate(33),
"my string is, maybe, a bit longer");