Skip to content

Commit

Permalink
Merge pull request #443 from mgeisler/release-0.15.0
Browse files Browse the repository at this point in the history
Release 0.15.0
  • Loading branch information
mgeisler committed Feb 27, 2022
2 parents 59c9fb3 + 3042ff4 commit 6fa2cd8
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 4 deletions.
58 changes: 58 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,64 @@
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);
```

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).

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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "textwrap"
version = "0.14.2"
version = "0.15.0"
authors = ["Martin Geisler <martin@geisler.net>"]
description = "Powerful library for word wrapping, indenting, and dedenting strings"
documentation = "https://docs.rs/textwrap/"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions images/textwrap-0.15.0.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/lib.rs
Expand Up @@ -112,7 +112,7 @@
//! The full dependency graph, where dashed lines indicate optional
//! dependencies, is shown below:
//!
//! <img src="https://raw.githubusercontent.com/mgeisler/textwrap/master/images/textwrap-0.14.2.svg">
//! <img src="https://raw.githubusercontent.com/mgeisler/textwrap/master/images/textwrap-0.15.0.svg">
//!
//! ## Default Features
//!
Expand Down Expand Up @@ -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)]
Expand Down

0 comments on commit 6fa2cd8

Please sign in to comment.