From 0f6091def0a38cbb33bf73dd64ca284ca9a6ce6e Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sun, 27 Feb 2022 14:11:52 +0000 Subject: [PATCH 1/3] Add dependency graph for version 0.15.0 --- images/textwrap-0.15.0.svg | 21 +++++++++++++++++++++ src/lib.rs | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 images/textwrap-0.15.0.svg diff --git a/images/textwrap-0.15.0.svg b/images/textwrap-0.15.0.svg new file mode 100644 index 00000000..bc234068 --- /dev/null +++ b/images/textwrap-0.15.0.svg @@ -0,0 +1,21 @@ + + + + +textwrap + +smawk + + + + + +unicode-linebreak + + + +unicode-width + + + + diff --git a/src/lib.rs b/src/lib.rs index 2ce602b8..e915df33 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -112,7 +112,7 @@ //! The full dependency graph, where dashed lines indicate optional //! dependencies, is shown below: //! -//! +//! //! //! ## Default Features //! From 9cc554e9b5bff4208b87b44445b1aa572cc83d63 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sun, 27 Feb 2022 14:11:53 +0000 Subject: [PATCH 2/3] Update changelog for version 0.15.0 --- CHANGELOG.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdc703ef..f6d9a632 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,65 @@ This file lists the most important changes made in each release of `textwrap`. +## Version 0.15.0 (2022-02-27) + +This is a major feature release with two main changes: + +* [#421](https://github.com/mgeisler/textwrap/pull/421): Use `f64` + instead of `usize` for fragment widths. + + This fixes problems with overflows in the internal computations of + `wrap_optimal_fit` when fragments (words) or line lenghts had + extreme values, such as `usize::MAX`. + +* [#438](https://github.com/mgeisler/textwrap/pull/438): Simplify + `Options` by removing generic type parameters. + + This change removes the new generic parameters introduced in version + 0.14, as well as the original `WrapSplitter` parameter which has + been present since very early versions. + + The result is a simplification of function and struct signatures + across the board. So what used to be + + ```rust + let options: Options< + wrap_algorithms::FirstFit, + word_separators::AsciiSpace, + word_splitters::HyphenSplitter, + > = Options::new(80); + ``` + + is now simply + + ```rust + let options: Options<'_> = Options::new(80); + ``` + + The anonymous lifetime represent the lifetime of the + `initial_indent` and `subsequent_indent` strings. + + The change is nearly performance neutral (a 1-2% regression). + +Smaller improvements and changes: + +* [#404](https://github.com/mgeisler/textwrap/pull/404): Make + documentation for short last-line penalty more precise. +* [#405](https://github.com/mgeisler/textwrap/pull/405): Cleanup and + simplify `Options` docstring. +* [#411](https://github.com/mgeisler/textwrap/pull/411): Default to + `OptimalFit` in interactive example. +* [#415](https://github.com/mgeisler/textwrap/pull/415): Add demo + program to help compute binary sizes. +* [#423](https://github.com/mgeisler/textwrap/pull/423): Add fuzz + tests with fully arbitrary fragments. +* [#424](https://github.com/mgeisler/textwrap/pull/424): Change + `wrap_optimal_fit` penalties to non-negative numbers. +* [#430](https://github.com/mgeisler/textwrap/pull/430): Add + `debug-words` example. +* [#432](https://github.com/mgeisler/textwrap/pull/432): Use precise + dependency versions in Cargo.toml. + ## Version 0.14.2 (2021-06-27) The 0.14.1 release included more changes than intended and has been From 3042ff47b35fbd54adfd2f73e780452650358817 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sun, 27 Feb 2022 14:13:12 +0000 Subject: [PATCH 3/3] Bump version to 0.15.0 --- CHANGELOG.md | 7 +++---- Cargo.toml | 2 +- README.md | 2 +- src/lib.rs | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6d9a632..093b9dc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,16 +32,15 @@ This is a major feature release with two main changes: > = Options::new(80); ``` - is now simply + if types are fully written out, is now simply ```rust let options: Options<'_> = Options::new(80); ``` The anonymous lifetime represent the lifetime of the - `initial_indent` and `subsequent_indent` strings. - - The change is nearly performance neutral (a 1-2% regression). + `initial_indent` and `subsequent_indent` strings. The change is + nearly performance neutral (a 1-2% regression). Smaller improvements and changes: diff --git a/Cargo.toml b/Cargo.toml index 21efc76c..7806ddeb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "textwrap" -version = "0.14.2" +version = "0.15.0" authors = ["Martin Geisler "] description = "Powerful library for word wrapping, indenting, and dedenting strings" documentation = "https://docs.rs/textwrap/" diff --git a/README.md b/README.md index 808d8411..9eeea079 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ drawn on a [HTML5 canvas using WebAssembly][wasm-demo]. To use the textwrap crate, add this to your `Cargo.toml` file: ```toml [dependencies] -textwrap = "0.14" +textwrap = "0.15" ``` By default, this enables word wrapping with support for Unicode diff --git a/src/lib.rs b/src/lib.rs index e915df33..6d68309a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -189,7 +189,7 @@ //! [terminal_size]: https://docs.rs/terminal_size/ //! [hyphenation]: https://docs.rs/hyphenation/ -#![doc(html_root_url = "https://docs.rs/textwrap/0.14.2")] +#![doc(html_root_url = "https://docs.rs/textwrap/0.15.0")] #![forbid(unsafe_code)] // See https://github.com/mgeisler/textwrap/issues/210 #![deny(missing_docs)] #![deny(missing_debug_implementations)]