13 releases

0.4.3 Dec 26, 2021
0.4.2 Dec 26, 2021
0.3.1 Dec 25, 2021
0.3.0 Nov 1, 2020
0.1.0 Mar 10, 2020

#1297 in Text processing

Download history 75/week @ 2023-12-17 61/week @ 2023-12-24 56/week @ 2023-12-31 97/week @ 2024-01-07 66/week @ 2024-01-14 74/week @ 2024-01-21 61/week @ 2024-01-28 59/week @ 2024-02-04 107/week @ 2024-02-11 102/week @ 2024-02-18 132/week @ 2024-02-25 120/week @ 2024-03-03 162/week @ 2024-03-10 154/week @ 2024-03-17 366/week @ 2024-03-24 385/week @ 2024-03-31

1,090 downloads per month
Used in 17 crates (5 directly)

MPL-2.0 license

12KB
228 lines

Text Toolbox

All designs only consider spaces and carriage returns, so sorry for Tab and CRLF.

All interfaces are function calls instead of traits.

Most interfaces return String instead of Cow<str>

Functions

Escaping

  • unescape:
  • unescape_utf8:
  • unescape_only:
  • url_encode: encoding strings with %
  • url_decode: decoding strings of %

Align

  • indent: adds spaces to each non-empty line
  • indent_with: adds prefix to each non-empty line
  • indent_count:
  • dedent: removes leading whitespace from each line
  • dedent_less_than: removes at most n leading whitespace from each line

Table


lib.rs:

Text utility function library

Interface

This library is biased towards input strings and returns new strings This library uses polymorphic interface

  • if accept String, use (impl Into<String>)
  • if accept &str, use (impl AsRef<str>)

Dependencies

~5MB
~106K SLoC