4 releases
0.1.3 | May 17, 2021 |
---|---|
0.1.2 | May 17, 2021 |
0.1.1 | May 17, 2021 |
0.1.0 | May 17, 2021 |
#252 in #token
74 downloads per month
Used in tvrank-cli
6KB
98 lines
Truncatable
Truncatable is a small rust crate for Strings that should append a follower when truncated (eg, ellipsis).
Usage
use truncatable::Truncatable;
let to_truncate = Truncatable::from("Hello World!").truncator("~~".into());
assert_eq!(to_truncate.truncate(5), String::from("Hello~~"));
lib.rs
:
truncatable
Truncatable is a simple crate for Strings that should append a follower when truncated (eg, ellipsis)
use truncatable::Truncatable;
let to_truncate = Truncatable::from("Hello World!").truncator("~~".into());
assert_eq!(to_truncate.truncate(5), String::from("Hello~~"));