aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2021-04-02 10:30:09 -0700
committerElliott Hughes <enh@google.com>2021-04-02 10:30:09 -0700
commita65267afe9568cef50669423d216f9d5def2feb1 (patch)
tree5924de54f325cea82a7fe223d079912e6c9fcf08
parent8686ddbeee87d2859ce0d5b50ed65b14e0aa692b (diff)
downloadtextwrap-a65267afe9568cef50669423d216f9d5def2feb1.tar.gz
Upgrade rust/crates/textwrap to 0.13.4
Test: make Change-Id: I96bdeea9d3ae11028d1ad06e070664896d895ae6
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--CHANGELOG.md14
-rw-r--r--Cargo.toml2
-rw-r--r--METADATA8
-rw-r--r--TEST_MAPPING9
-rw-r--r--src/core.rs10
-rw-r--r--src/lib.rs10
7 files changed, 32 insertions, 23 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 3e4b610..3237c3c 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "ad143f1be460a4bab07a6ad5d0f408c1cbb50ac7"
+ "sha1": "c0a0db1a1460f8923f3cb8d8aa4366ce61237211"
}
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 05d22af..3d75e30 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,16 @@
This file lists the most important changes made in each release of
`textwrap`.
+## Version 0.13.4 (2021-02-23)
+
+This release removes `println!` statements which was left behind in
+`unfill` by mistake.
+
+* [#296](https://github.com/mgeisler/textwrap/pull/296): Improve house
+ building example with more comments.
+* [#297](https://github.com/mgeisler/textwrap/pull/297): Remove debug
+ prints in the new `unfill` function.
+
## Version 0.13.3 (2021-02-20)
This release contains a bugfix for `indent` and improved handling of
@@ -13,7 +23,9 @@ and functions for reformatting already wrapped text.
`core::display_width` to handle emojis when the unicode-width Cargo
feature is disabled.
* [#279](https://github.com/mgeisler/textwrap/pull/279): Make `indent`
- preserve existing newlines in the input string.
+ preserve existing newlines in the input string. Before,
+ `indent("foo", "")` would return `"foo\n"` by mistake. It now
+ returns `"foo"` instead.
* [#281](https://github.com/mgeisler/textwrap/pull/281): Ensure all
`Options` fields have examples.
* [#282](https://github.com/mgeisler/textwrap/pull/282): Add a
diff --git a/Cargo.toml b/Cargo.toml
index b49a99e..61abe49 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
[package]
edition = "2018"
name = "textwrap"
-version = "0.13.3"
+version = "0.13.4"
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 08130cc..dfad3bc 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/textwrap/textwrap-0.13.3.crate"
+ value: "https://static.crates.io/crates/textwrap/textwrap-0.13.4.crate"
}
- version: "0.13.3"
+ version: "0.13.4"
license_type: NOTICE
last_upgrade_date {
year: 2021
- month: 2
- day: 22
+ month: 4
+ day: 2
}
}
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 661ac5c..a731acb 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -2,16 +2,13 @@
{
"presubmit": [
{
- "name": "authfs_device_test_src_lib"
- },
- {
- "name": "vpnprofilestore_test"
- },
- {
"name": "keystore2_test"
},
{
"name": "libsqlite3-sys_device_test_src_lib"
+ },
+ {
+ "name": "vpnprofilestore_test"
}
]
}
diff --git a/src/core.rs b/src/core.rs
index dc00454..b6f5b46 100644
--- a/src/core.rs
+++ b/src/core.rs
@@ -562,7 +562,7 @@ pub enum WrapAlgorithm {
/// name: &'a str,
/// hours: usize, // Time needed to complete task.
/// sweep: usize, // Time needed for a quick sweep after task during the day.
-/// cleanup: usize, // Time needed to cleanup after task at end of day.
+/// cleanup: usize, // Time needed for full cleanup if day ends with this task.
/// }
///
/// impl Fragment for Task<'_> {
@@ -584,9 +584,15 @@ pub enum WrapAlgorithm {
/// Task { name: "Bathrooms", hours: 2, sweep: 1, cleanup: 2 },
/// ];
///
+/// // Fill tasks into days, taking `day_length` into account. The
+/// // output shows the hours worked per day along with the names of
+/// // the tasks for that day.
/// fn assign_days<'a>(tasks: &[Task<'a>], day_length: usize) -> Vec<(usize, Vec<&'a str>)> {
/// let mut days = Vec::new();
-/// for day in wrap_first_fit(&tasks, |i| day_length) {
+/// // Assign tasks to days. The assignment is a vector of slices,
+/// // with a slice per day.
+/// let assigned_days: Vec<&[Task<'a>]> = wrap_first_fit(&tasks, |i| day_length);
+/// for day in assigned_days.iter() {
/// let last = day.last().unwrap();
/// let work_hours: usize = day.iter().map(|t| t.hours + t.sweep).sum();
/// let names = day.iter().map(|t| t.name).collect::<Vec<_>>();
diff --git a/src/lib.rs b/src/lib.rs
index 1781b63..ee6d5d8 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.13.3.svg">
+//! <img src="https://raw.githubusercontent.com/mgeisler/textwrap/master/images/textwrap-0.13.4.svg">
//!
//! ## Default Features
//!
@@ -165,7 +165,7 @@
//! [terminal_size]: https://docs.rs/terminal_size/
//! [hyphenation]: https://docs.rs/hyphenation/
-#![doc(html_root_url = "https://docs.rs/textwrap/0.13.3")]
+#![doc(html_root_url = "https://docs.rs/textwrap/0.13.4")]
#![forbid(unsafe_code)] // See https://github.com/mgeisler/textwrap/issues/210
#![deny(missing_docs)]
#![deny(missing_debug_implementations)]
@@ -681,8 +681,6 @@ pub fn unfill<'a>(text: &'a str) -> (String, Options<'a, HyphenSplitter>) {
let without_prefix = line.trim_start_matches(prefix_chars);
let prefix = &line[..line.len() - without_prefix.len()];
- println!("line: {:?} -> prefix: {:?}", line, prefix);
-
if idx == 0 {
options.initial_indent = prefix;
} else if idx == 1 {
@@ -710,11 +708,7 @@ pub fn unfill<'a>(text: &'a str) -> (String, Options<'a, HyphenSplitter>) {
}
}
- println!("pushing trailing newlines: {:?}", &text[trimmed.len()..]);
unfilled.push_str(&text[trimmed.len()..]);
-
- println!("unfilled: {:?}", unfilled);
-
(unfilled, options)
}