aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Galenson <jgalenson@google.com>2021-08-11 14:55:05 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-08-11 14:55:05 +0000
commit3612ba8ccac3d9ef9d63ee2daa08af7aa449b93e (patch)
tree6aa0f21789420de0426b6a6959e11d259ddaa451
parent8eaadc1276fa7a6419e3cdfe46ca7400ccad7294 (diff)
parent8197d76012c2e42af7c93c03c92d65df910a96dc (diff)
downloadtextwrap-3612ba8ccac3d9ef9d63ee2daa08af7aa449b93e.tar.gz
Upgrade rust/crates/textwrap to 0.14.2 am: a70ac09a22 am: 105a66fedd am: 8197d76012
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/textwrap/+/1791049 Change-Id: Icc8e3e41cc9b4b11239ba468bf9c5702b0e2e533
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--CHANGELOG.md12
-rw-r--r--Cargo.toml2
-rw-r--r--METADATA8
-rw-r--r--src/lib.rs10
-rw-r--r--src/word_separators.rs2
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
diff --git a/Cargo.toml b/Cargo.toml
index 037ae2f..69acb0f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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"
diff --git a/METADATA b/METADATA
index 59cabda..66d4b14 100644
--- a/METADATA
+++ b/METADATA
@@ -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
}
}
diff --git a/src/lib.rs b/src/lib.rs
index 5a3f4b1..f2f5542 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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,