Skip to content

Releases: mgeisler/textwrap

textwrap-0.7.0

24 Nov 08:52
Compare
Choose a tag to compare

Version 0.7.0 changes the return type of Wrapper::wrap from Vec<String> to Vec<Cow<'a, str>>. This means that the output lines borrow data from the input string. This is a breaking API change if you relied on the exact return type of Wrapper::wrap. Callers of the textwrap::fill convenience function will see no breakage.

The above change and other optimizations makes version 0.7.0 roughly 15-30% faster than version 0.6.0.

The squeeze_whitespace option has been removed since it was complicating the above optimization. Let us know if this option is important for you so we can provide a work around.

  • Fixed #58: Add a fast_wrap function.
  • Fixed #61: Documentation errors.

textwrap-0.6.0

24 Nov 08:50
Compare
Choose a tag to compare

Version 0.6.0 adds builder methods to Wrapper for easy one-line initialization and configuration:

let wrapper = Wrapper::new(60).break_words(false);

It also add a new NoHyphenation word splitter that will never split words, not even at existing hyphens.

  • Fixed #28: Support not squeezing whitespace.

textwrap-0.5.0

24 Nov 08:49
Compare
Choose a tag to compare

Version 0.5.0 has breaking API changes. However, this only affects code using the hyphenation feature. The feature is now optional, so
you will first need to enable the hyphenation feature as described above. Afterwards, please change your code from

wrapper.corpus = Some(&corpus);

to

wrapper.splitter = Box::new(corpus);

Other changes include optimizations, so version 0.5.0 is roughly 10-15% faster than version 0.4.0.

  • Fixed #19: Add support for finding terminal size.
  • Fixed #25: Handle words longer than self.width.
  • Fixed #26: Support custom indentation.
  • Fixed #36: Support building without hyphenation.
  • Fixed #39: Respect non-breaking spaces.

textwrap-0.4.0

24 Nov 08:47
Compare
Choose a tag to compare

Documented complexities and tested these via cargo bench.

  • Fixed #13: Immediately add word if it fits.
  • Fixed #14: Avoid splitting on initial hyphens.

textwrap-0.3.0

24 Nov 08:46
Compare
Choose a tag to compare

Added support for automatic hyphenation.

textwrap-0.2.0

21 Nov 10:44
Compare
Choose a tag to compare

Introduced Wrapper struct. Added support for wrapping on hyphens.

textwrap-0.1.0

21 Nov 10:43
Compare
Choose a tag to compare

First public release with support for wrapping strings on whitespace.