#string #ellipsis #token #truncated

truncatable

Small crate for truncatable strings

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

Download history 15/week @ 2024-07-22 10/week @ 2024-07-29 72/week @ 2024-09-02 8/week @ 2024-09-16 14/week @ 2024-09-23 10/week @ 2024-09-30

74 downloads per month
Used in tvrank-cli

GPL-3.0-only

6KB
98 lines

Truncatable

Truncatable is a small rust crate for Strings that should append a follower when truncated (eg, ellipsis).

Crates.io Build

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~~"));

No runtime deps