aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Walbran <qwandor@google.com>2023-01-11 11:58:19 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-01-11 11:58:19 +0000
commitb89aa6b314320074751f256a32dc0cb469db59ec (patch)
tree31857d0ef19221f935f23fa5db8002aab8f9e0d6
parentcbd02b4100b0affa306b087bbfec1b996fb77531 (diff)
parenta74665ddcfdeee8fd68e60f578135467d807f3d6 (diff)
downloadclap_lex-b89aa6b314320074751f256a32dc0cb469db59ec.tar.gz
Merge "Upgrade clap_lex to 0.3.0." am: ea291e5feb am: 89677d8ec6 am: a74665ddcf
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/clap_lex/+/2322658 Change-Id: I80aeba7c8c2166965a5986cd77b4e68cbf0b55db Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--.cargo_vcs_info.json6
-rw-r--r--Android.bp58
-rw-r--r--Cargo.toml5
-rw-r--r--Cargo.toml.orig4
l---------LICENSE2
-rw-r--r--METADATA19
-rw-r--r--MODULE_LICENSE_APACHE2 (renamed from MODULE_LICENSE_MIT)0
-rw-r--r--README.md8
-rw-r--r--cargo2android.json6
-rw-r--r--src/lib.rs8
10 files changed, 43 insertions, 73 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
new file mode 100644
index 0000000..658595e
--- /dev/null
+++ b/.cargo_vcs_info.json
@@ -0,0 +1,6 @@
+{
+ "git": {
+ "sha1": "af64699912401443786d84fe040f5d93761300d1"
+ },
+ "path_in_vcs": "clap_lex"
+} \ No newline at end of file
diff --git a/Android.bp b/Android.bp
index 1c98b55..c4772c7 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,68 +1,14 @@
-// This file is generated by cargo2android.py --run --device --tests.
+// This file is generated by cargo2android.py --config cargo2android.json.
// Do not modify this file as changes will be overridden on upgrade.
-package {
- default_applicable_licenses: ["external_rust_crates_clap_lex_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.
-//
-// large-scale-change included anything that looked like it might be a license
-// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
-//
-// Please consider removing redundant or irrelevant files from 'license_text:'.
-// See: http://go/android-license-faq
-license {
- name: "external_rust_crates_clap_lex_license",
- visibility: [":__subpackages__"],
- license_kinds: [
- "SPDX-license-identifier-Apache-2.0",
- "SPDX-license-identifier-MIT",
- ],
- license_text: [
- "LICENSE-APACHE",
- "LICENSE-MIT",
- ],
-}
-
-rust_test {
- name: "clap_lex_test_src_lib",
- host_supported: true,
- crate_name: "clap_lex",
- cargo_env_compat: true,
- cargo_pkg_version: "0.2.4",
- srcs: ["src/lib.rs"],
- test_suites: ["general-tests"],
- auto_gen_config: true,
- test_options: {
- unit_test: true,
- },
- edition: "2021",
- rustlibs: [
- "libos_str_bytes",
- ],
-}
-
rust_library {
name: "libclap_lex",
host_supported: true,
crate_name: "clap_lex",
cargo_env_compat: true,
- cargo_pkg_version: "0.2.4",
+ cargo_pkg_version: "0.3.0",
srcs: ["src/lib.rs"],
edition: "2021",
rustlibs: [
diff --git a/Cargo.toml b/Cargo.toml
index ef51210..d685925 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,9 +11,9 @@
[package]
edition = "2021"
-rust-version = "1.56.1"
+rust-version = "1.60.0"
name = "clap_lex"
-version = "0.2.4"
+version = "0.3.0"
include = [
"build.rs",
"src/**/*",
@@ -24,6 +24,7 @@ include = [
"examples/**/*",
]
description = "Minimal, flexible command line parser"
+readme = "README.md"
keywords = [
"argument",
"cli",
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 9883033..e3cc855 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
[package]
name = "clap_lex"
-version = "0.2.4"
+version = "0.3.0"
description = "Minimal, flexible command line parser"
repository = "https://github.com/clap-rs/clap/tree/master/clap_lex"
categories = ["command-line-interface"]
@@ -13,7 +13,7 @@ keywords = [
]
license = "MIT OR Apache-2.0"
edition = "2021"
-rust-version = "1.56.1" # MSRV
+rust-version = "1.60.0" # MSRV
include = [
"build.rs",
"src/**/*",
diff --git a/LICENSE b/LICENSE
index 7f9a88e..6b579aa 120000
--- a/LICENSE
+++ b/LICENSE
@@ -1 +1 @@
-LICENSE-MIT \ No newline at end of file
+LICENSE-APACHE \ No newline at end of file
diff --git a/METADATA b/METADATA
index 00604ea..c61ab36 100644
--- a/METADATA
+++ b/METADATA
@@ -1,13 +1,20 @@
name: "clap_lex"
-description:
- "Minimal, flexible command line parser."
-
+description: "Minimal, flexible command line parser"
third_party {
url {
+ type: HOMEPAGE
+ value: "https://crates.io/crates/clap_lex"
+ }
+ url {
type: ARCHIVE
- value:"https://crates.io/crates/clap_lex"
+ value: "https://static.crates.io/crates/clap_lex/clap_lex-0.3.0.crate"
}
- version: "0.2.4"
- last_upgrade_date { year: 2022 month: 6 day: 30 }
+ version: "0.3.0"
+ # Dual-licensed, using the least restrictive per go/thirdpartylicenses#same.
license_type: NOTICE
+ last_upgrade_date {
+ year: 2022
+ month: 11
+ day: 30
+ }
}
diff --git a/MODULE_LICENSE_MIT b/MODULE_LICENSE_APACHE2
index e69de29..e69de29 100644
--- a/MODULE_LICENSE_MIT
+++ b/MODULE_LICENSE_APACHE2
diff --git a/README.md b/README.md
index 887b953..eebd4c5 100644
--- a/README.md
+++ b/README.md
@@ -5,15 +5,15 @@
[![Crates.io](https://img.shields.io/crates/v/clap_lex?style=flat-square)](https://crates.io/crates/clap_lex)
[![Crates.io](https://img.shields.io/crates/d/clap_lex?style=flat-square)](https://crates.io/crates/clap_lex)
-[![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_lex-v0.2.4/LICENSE-APACHE)
-[![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_lex-v0.2.4/LICENSE-MIT)
+[![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_lex-v0.3.0/LICENSE-APACHE)
+[![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_lex-v0.3.0/LICENSE-MIT)
Dual-licensed under [Apache 2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT).
1. [About](#about)
2. [API Reference](https://docs.rs/clap_lex)
3. [Questions & Discussions](https://github.com/clap-rs/clap/discussions)
-4. [CONTRIBUTING](https://github.com/clap-rs/clap/blob/clap_lex-v0.2.4/clap_lex/CONTRIBUTING.md)
-5. [Sponsors](https://github.com/clap-rs/clap/blob/clap_lex-v0.2.4/README.md#sponsors)
+4. [CONTRIBUTING](https://github.com/clap-rs/clap/blob/clap_lex-v0.3.0/clap_lex/CONTRIBUTING.md)
+5. [Sponsors](https://github.com/clap-rs/clap/blob/clap_lex-v0.3.0/README.md#sponsors)
## About
diff --git a/cargo2android.json b/cargo2android.json
new file mode 100644
index 0000000..3ebdf72
--- /dev/null
+++ b/cargo2android.json
@@ -0,0 +1,6 @@
+{
+ "dependencies": true,
+ "device": true,
+ "run": true,
+ "tests": true
+}
diff --git a/src/lib.rs b/src/lib.rs
index f205c3d..bc4d4ba 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -229,10 +229,14 @@ impl RawArgs {
}
/// Inject arguments before the [`RawArgs::next`]
- pub fn insert(&mut self, cursor: &ArgCursor, insert_items: &[&str]) {
+ pub fn insert(
+ &mut self,
+ cursor: &ArgCursor,
+ insert_items: impl IntoIterator<Item = impl Into<OsString>>,
+ ) {
self.items.splice(
cursor.cursor..cursor.cursor,
- insert_items.iter().map(OsString::from),
+ insert_items.into_iter().map(Into::into),
);
}