Snap for 7163567 from 8853555555097ee51e9cd2cae75f3001f67b3cf2 to sc-d1-release
Change-Id: Ib06cbd0902a1fce5cbb49ce95158f2a06dffcea4
diff --git a/Android.bp b/Android.bp
index 8180599..2edc035 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,34 +1,5 @@
// This file is generated by cargo2android.py --run --dependencies --features= --device.
-
-package {
- default_applicable_licenses: ["external_rust_crates_clap_license"],
-}
-
-// Added automatically by a large-scale-change that took the approach of
-// 'apply every license found to every target'. While this makes sure we respect
-// every license restriction, it may not be entirely correct.
-//
-// e.g. GPL in an MIT project might only apply to the contrib/ directory.
-//
-// Please consider splitting the single license below into multiple licenses,
-// taking care not to lose any license_kind information, and overriding the
-// default license using the 'licenses: [...]' property on targets as needed.
-//
-// For unused files, consider creating a 'fileGroup' with "//visibility:private"
-// to attach the license to, and including a comment whether the files may be
-// used in the current project.
-// See: http://go/android-license-faq
-license {
- name: "external_rust_crates_clap_license",
- visibility: [":__subpackages__"],
- license_kinds: [
- "SPDX-license-identifier-Apache-2.0",
- "SPDX-license-identifier-MIT",
- ],
- license_text: [
- "LICENSE-MIT",
- ],
-}
+// Do not modify this file as changes will be overridden on upgrade.
rust_library {
name: "libclap",
@@ -40,11 +11,9 @@
rustlibs: [
"libbitflags",
"libtextwrap",
- "libunicode_width",
],
}
// dependent_library ["feature_list"]
// bitflags-1.2.1 "default"
-// textwrap-0.11.0
-// unicode-width-0.1.8 "default"
+// textwrap-0.13.3
diff --git a/Cargo.toml b/Cargo.toml
index 683a040..c0a1669 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -71,15 +71,18 @@
version = "0.8"
optional = true
-[dependencies.term_size]
-version = "0.3.0"
+[dependencies.terminal_size]
+version = "0.1.12"
optional = true
[dependencies.textwrap]
-version = "0.11.0"
+version = "0.13"
+default-features = false
+features = []
[dependencies.unicode-width]
-version = "0.1.4"
+version = "0.1"
+optional = true
[dependencies.vec_map]
version = "0.8"
@@ -107,7 +110,8 @@
no_cargo = []
suggestions = ["strsim"]
unstable = []
-wrap_help = ["term_size", "textwrap/term_size"]
+wrap_help = ["terminal_size", "textwrap/terminal_size"]
+unicode_help= ["unicode-width", "textwrap/unicode-width"] # Enable if any unicode in help message
yaml = ["yaml-rust"]
[target."cfg(not(windows))".dependencies.ansi_term]
version = "0.11"
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 6716814..6b7ed9a 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,8 +1,14 @@
-// Generated by cargo2android.py for tests in Android.bp
+// Generated by update_crate_tests.py for tests that depend on this crate.
{
"presubmit": [
{
"name": "libsqlite3-sys_device_test_src_lib"
+ },
+ {
+ "name": "authfs_device_test_src_lib"
+ },
+ {
+ "name": "keystore2_test"
}
]
}
diff --git a/src/app/help.rs b/src/app/help.rs
index 4751fe7..ef57dbb 100644
--- a/src/app/help.rs
+++ b/src/app/help.rs
@@ -20,7 +20,6 @@
#[cfg(feature = "wrap_help")]
use term_size;
use textwrap;
-use unicode_width::UnicodeWidthStr;
#[cfg(not(feature = "wrap_help"))]
mod term_size {
@@ -30,6 +29,10 @@
}
fn str_width(s: &str) -> usize {
+ #[cfg(not(feature = "unicode_help"))]
+ return s.len();
+
+ #[cfg(feature = "unicode_help")]
UnicodeWidthStr::width(s)
}
@@ -1012,9 +1015,9 @@
}
fn wrap_help(help: &str, avail_chars: usize) -> String {
- let wrapper = textwrap::Wrapper::new(avail_chars).break_words(false);
+ let wrapper = textwrap::Options::new(avail_chars).break_words(false);
help.lines()
- .map(|line| wrapper.fill(line))
+ .map(|line| textwrap::fill(line, &wrapper))
.collect::<Vec<String>>()
.join("\n")
}
diff --git a/src/lib.rs b/src/lib.rs
index 17e2697..7dbb0f0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -552,7 +552,6 @@
#[cfg(feature = "wrap_help")]
extern crate term_size;
extern crate textwrap;
-extern crate unicode_width;
#[cfg(feature = "vec_map")]
extern crate vec_map;
#[cfg(feature = "yaml")]