Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump textwrap from 0.11.0 to 0.14.0 #41

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github Jun 7, 2021

Bumps textwrap from 0.11.0 to 0.14.0.

Release notes

Sourced from textwrap's releases.

textwrap-0.14.0

Version 0.14.0 (2021-06-05)

This is a major feature release which makes Textwrap more configurable and flexible. The high-level API of textwrap::wrap and textwrap::fill remains unchanged, but low-level structs have moved around.

The biggest change is the introduction of new generic type parameters to the Options struct. These parameters lets you statically configure the wrapping algorithm, the word separator, and the word splitter. If you previously spelled out the full type for Options, you now need to take the extra type parameters into account. This means that

let options: Options<HyphenSplitter> = Options::new(80);

changes to

let options: Options<
    wrap_algorithms::FirstFit,
    word_separators::AsciiSpace,
    word_splitters::HyphenSplitter,
> = Options::new(80);

This is quite a mouthful, so we suggest using type inferrence where possible. You won’t see any chance if you call wrap directly with a width or with an Options value constructed on the fly. Please open an issue if this causes problems for you!

New WordSeparator Trait

  • #332: Add WordSeparator trait to allow customizing how words are found in a line of text. Until now, Textwrap would always assume that words are separated by ASCII space characters. You can now customize this as needed.

  • #313: Add support for using the Unicode line breaking algorithm to find words. This is done by adding a second implementation of the new WordSeparator trait. The implementation uses the unicode-linebreak crate, which is a new optional dependency.

    With this, Textwrap can be used with East-Asian languages such as Chinese or Japanese where there are no spaces between words. Breaking a long sequence of emojis is another example where line breaks might be wanted even if there are no whitespace to be found. Feedback would be appreciated for this feature.

Indent

  • #353: Trim trailing whitespace from prefix in indent.

    Before, empty lines would get no prefix added. Now, empty lines have a trimmed prefix added. This little trick makes indent much more useful since you can now safely indent with "# " without creating trailing whitespace in the output due to the trailing whitespace in your prefix.

  • #354: Make indent about 20% faster by preallocating the output string.

Documentation

  • #308: Document handling of leading and trailing whitespace when wrapping text.

WebAssembly Demo

New Generic Parameters

... (truncated)

Changelog

Sourced from textwrap's changelog.

Version 0.14.0 (2021-06-05)

This is a major feature release which makes Textwrap more configurable and flexible. The high-level API of textwrap::wrap and textwrap::fill remains unchanged, but low-level structs have moved around.

The biggest change is the introduction of new generic type parameters to the Options struct. These parameters lets you statically configure the wrapping algorithm, the word separator, and the word splitter. If you previously spelled out the full type for Options, you now need to take the extra type parameters into account. This means that

let options: Options<HyphenSplitter> = Options::new(80);

changes to

let options: Options<
    wrap_algorithms::FirstFit,
    word_separators::AsciiSpace,
    word_splitters::HyphenSplitter,
> = Options::new(80);

This is quite a mouthful, so we suggest using type inferrence where possible. You won’t see any chance if you call wrap directly with a width or with an Options value constructed on the fly. Please open an issue if this causes problems for you!

New WordSeparator Trait

  • #332: Add WordSeparator trait to allow customizing how words are found in a line of text. Until now, Textwrap would always assume that words are separated by ASCII space characters. You can now customize this as needed.

  • #313: Add support for using the Unicode line breaking algorithm to find words. This is done by adding a second implementation of the new WordSeparator trait. The implementation uses the unicode-linebreak crate, which is a new optional dependency.

    With this, Textwrap can be used with East-Asian languages such as Chinese or Japanese where there are no spaces between words. Breaking a long sequence of emojis is another example where line

... (truncated)

Commits
  • 65277f5 Merge pull request #373 from mgeisler/release-0.14.0
  • 1be7943 Bump version to 0.14.0
  • 8a0e97d Update changelog for version 0.14.0
  • aa86be7 Add dependency graph for version 0.14.0
  • 552eaa6 Ensure we update the changelog with all PRs since the last release
  • 85d2c1c Merge pull request #379 from mgeisler/disable-wrap-algo-select
  • a475095 Merge pull request #378 from mgeisler/better-splitter-name
  • 9dc8e03 Use more descriptive word splitter name
  • f81941c Disable the WrapAlgorithm select field for now
  • d25bc65 Merge pull request #377 from tapeinosyne/master
  • 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.14.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.14.0)

---
updated-dependencies:
- dependency-name: textwrap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jun 7, 2021
@dependabot @github
Copy link
Author

dependabot bot commented on behalf of github Jun 28, 2021

Superseded by #43.

@dependabot dependabot bot closed this Jun 28, 2021
@dependabot dependabot bot deleted the dependabot/cargo/textwrap-0.14.0 branch June 28, 2021 10:05
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