diff options
author | Joel Galenson <jgalenson@google.com> | 2021-08-11 15:23:28 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-08-11 15:23:28 +0000 |
commit | 0ffce773f9c0d5ceab27ab23fef2c58e00fa55f2 (patch) | |
tree | 6aa0f21789420de0426b6a6959e11d259ddaa451 | |
parent | 2b6ddaa9d7006c9ff24a9539b953524d579c671e (diff) | |
parent | 63b034d90c451f78aa9d1da5997430e14fcd2de4 (diff) | |
download | textwrap-0ffce773f9c0d5ceab27ab23fef2c58e00fa55f2.tar.gz |
Upgrade rust/crates/textwrap to 0.14.2 am: a70ac09a22 am: 105a66fedd am: 8197d76012 am: 3612ba8cca am: 63b034d90c
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/textwrap/+/1791049
Change-Id: If9e00fd460512955e8310307fa168b0480660c97
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | CHANGELOG.md | 12 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | METADATA | 8 | ||||
-rw-r--r-- | src/lib.rs | 10 | ||||
-rw-r--r-- | src/word_separators.rs | 2 |
6 files changed, 27 insertions, 9 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 3d9a69b..bc2eb0e 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "65277f5c22aa71fb60d5c53142cadf0c8fcadf28" + "sha1": "1964d6f19d8e84fa08e3dd8a8c986ecd26287367" } } diff --git a/CHANGELOG.md b/CHANGELOG.md index 534072e..cdc703e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ This file lists the most important changes made in each release of `textwrap`. +## Version 0.14.2 (2021-06-27) + +The 0.14.1 release included more changes than intended and has been +yanked. The change intended for 0.14.1 is now included in 0.14.2. + +## Version 0.14.1 (2021-06-26) + +This release fixes a panic reported by @Makoto, thanks! + +* [#391](https://github.com/mgeisler/textwrap/pull/391): Fix panic in + `find_words` due to string access outside of a character boundary. + ## Version 0.14.0 (2021-06-05) This is a major feature release which makes Textwrap more configurable @@ -13,7 +13,7 @@ [package] edition = "2018" name = "textwrap" -version = "0.14.0" +version = "0.14.2" authors = ["Martin Geisler <martin@geisler.net>"] exclude = [".github/", ".gitignore", "benches/", "examples/", "fuzz/", "images/"] description = "Powerful library for word wrapping, indenting, and dedenting strings" @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/textwrap/textwrap-0.14.0.crate" + value: "https://static.crates.io/crates/textwrap/textwrap-0.14.2.crate" } - version: "0.14.0" + version: "0.14.2" license_type: NOTICE last_upgrade_date { year: 2021 - month: 6 - day: 21 + month: 8 + day: 9 } } @@ -124,7 +124,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.0.svg"> +//! <img src="https://raw.githubusercontent.com/mgeisler/textwrap/master/images/textwrap-0.14.2.svg"> //! //! ## Default Features //! @@ -177,7 +177,7 @@ //! [terminal_size]: https://docs.rs/terminal_size/ //! [hyphenation]: https://docs.rs/hyphenation/ -#![doc(html_root_url = "https://docs.rs/textwrap/0.14.0")] +#![doc(html_root_url = "https://docs.rs/textwrap/0.14.2")] #![forbid(unsafe_code)] // See https://github.com/mgeisler/textwrap/issues/210 #![deny(missing_docs)] #![deny(missing_debug_implementations)] @@ -1851,6 +1851,12 @@ mod tests { } #[test] + fn fill_unicode_boundary() { + // https://github.com/mgeisler/textwrap/issues/390 + fill("\u{1b}!Ͽ", 10); + } + + #[test] #[cfg(not(feature = "smawk"))] #[cfg(not(feature = "unicode-linebreak"))] fn cloning_works() { diff --git a/src/word_separators.rs b/src/word_separators.rs index cb1b8a9..db03a91 100644 --- a/src/word_separators.rs +++ b/src/word_separators.rs @@ -216,7 +216,7 @@ impl WordSeparator for UnicodeBreakProperties { let mut opportunities = unicode_linebreak::linebreaks(&stripped) .filter(|(idx, _)| { #[allow(clippy::match_like_matches_macro)] - match &line[..*idx].chars().next_back() { + match &stripped[..*idx].chars().next_back() { // We suppress breaks at ‘-’ since we want to control // this via the WordSplitter. Some('-') => false, |