Skip to content

Bump textwrap from 0.11.0 to 0.13.0 - #18

Closed
dependabot[bot] wants to merge 1 commit into
masterfrom
dependabot/cargo/textwrap-0.13.0
Closed

Bump textwrap from 0.11.0 to 0.13.0#18
dependabot[bot] wants to merge 1 commit into
masterfrom
dependabot/cargo/textwrap-0.13.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Dec 7, 2020

Copy link
Copy Markdown

Bumps textwrap from 0.11.0 to 0.13.0.

Release notes

Sourced from textwrap's releases.

textwrap-0.13.0

This is a major release which rewrites the core logic, adds many new features, and fixes a couple of bugs. Most programs which use textwrap stays the same, incompatibilities and upgrade notes are given below.

Clone the repository and run the following to explore the new features in an interactive demo (Linux only):

$ cargo run --example interactive --all-features

Bug Fixes

Rewritten core wrapping algorithm

  • #221: Reformulate wrapping in terms of words with whitespace and penalties.

The core wrapping algorithm has been completely rewritten. This fixed bugs and simplified the code, while also making it possible to use textwrap outside the context of the terminal.

As part of this, trailing whitespace is now discarded consistently from wrapped lines. Before we would inconsistently remove whitespace at the end of wrapped lines, except for the last. Leading whitespace is still preserved.

New Features

Optimal-fit wrapping

  • #234: Introduce wrapping using an optimal-fit algorithm.

This release adds support for new wrapping algorithm which finds a globally optimal set of line breaks, taking certain penalties into account. As an example, the old algorithm would produce

"To be, or"
"not to be:"
"that is"
"the"
"question"

Notice how the fourth line with “the” is very short. The new algorithm shortens the previous lines slightly to produce fewer short lines:

"To be,"
"or not to"
"be: that"
"is the"
"question"

Use the new textwrap::core::WrapAlgorithm enum to select between the new and old algorithm. By default, the new algorithm is used.

The optimal-fit algorithm is inspired by the line breaking algorithm used in TeX, described in the 1981 article Breaking Paragraphs into Lines by Knuth and Plass.

In-place wrapping

  • #226: Add a fill_inplace function.

When the text you want to fill is already a temporary String, you can now mutate it in-place with fill_inplace:

... (truncated)

Changelog

Sourced from textwrap's changelog.

Version 0.13.0 — December 5th, 2020

This is a major release which rewrites the core logic, adds many new features, and fixes a couple of bugs. Most programs which use textwrap stays the same, incompatibilities and upgrade notes are given below.

Clone the repository and run the following to explore the new features in an interactive demo (Linux only):

$ cargo run --example interactive --all-features

Bug Fixes

Rewritten core wrapping algorithm

  • #221: Reformulate wrapping in terms of words with whitespace and penalties.

The core wrapping algorithm has been completely rewritten. This fixed bugs and simplified the code, while also making it possible to use textwrap outside the context of the terminal.

As part of this, trailing whitespace is now discarded consistently from wrapped lines. Before we would inconsistently remove whitespace at the end of wrapped lines, except for the last. Leading whitespace is still preserved.

New Features

Optimal-fit wrapping

  • #234: Introduce wrapping using an optimal-fit algorithm.

This release adds support for new wrapping algorithm which finds a globally optimal set of line breaks, taking certain penalties into account. As an example, the old algorithm would produce

"To be, or"
"not to be:"
"that is"
"the"
"question"

Notice how the fourth line with “the” is very short. The new algorithm shortens the previous lines slightly to produce fewer short lines:

... (truncated)

Commits
  • b144032 Merge pull request #243 from mgeisler/release-0.13.0
  • e266e1a Bump version to 0.13.0
  • 8df6fa3 Update examples in README to show the new optimal-fit wrapping
  • a0874b2 Prepare changelog for version 0.13.0
  • 3cdbfd4 Merge pull request #242 from mgeisler/rephrase-docstring
  • 493193f Fix phrasing in docstring
  • c293105 Merge pull request #239 from mgeisler/emperors-new-clothes
  • c383746 Add start of Emperor’s New Clothes to interactive demo text
  • f362af1 Merge pull request #241 from mgeisler/trailing-whitespace-demo
  • f42f810 Show trailing spaces in interactive demo
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [textwrap](https://github.com/mgeisler/textwrap) from 0.11.0 to 0.13.0.
- [Release notes](https://github.com/mgeisler/textwrap/releases)
- [Changelog](https://github.com/mgeisler/textwrap/blob/master/CHANGELOG.md)
- [Commits](mgeisler/textwrap@0.11.0...0.13.0)

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added the dependencies Pull requests that update a dependency file label Dec 7, 2020
@dependabot @github

dependabot Bot commented on behalf of github Dec 11, 2020

Copy link
Copy Markdown
Author

Superseded by #19.

@dependabot dependabot Bot closed this Dec 11, 2020
@dependabot
dependabot Bot deleted the dependabot/cargo/textwrap-0.13.0 branch December 11, 2020 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants