From 716b366d0f15d93fbd929dcb1cc3474d57ef650c Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Wed, 30 Nov 2022 13:53:11 +0000 Subject: Upgrade clap_lex to 0.3.0. Change-Id: Ib0016025d8c90015123452191b855c23fa98945d --- .cargo_vcs_info.json | 6 ++++++ Android.bp | 58 ++------------------------------------------------ Cargo.toml | 5 +++-- Cargo.toml.orig | 4 ++-- LICENSE | 2 +- METADATA | 19 +++++++++++------ MODULE_LICENSE_APACHE2 | 0 MODULE_LICENSE_MIT | 0 README.md | 8 +++---- cargo2android.json | 6 ++++++ src/lib.rs | 8 +++++-- 11 files changed, 43 insertions(+), 73 deletions(-) create mode 100644 .cargo_vcs_info.json create mode 100644 MODULE_LICENSE_APACHE2 delete mode 100644 MODULE_LICENSE_MIT create mode 100644 cargo2android.json 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_APACHE2 b/MODULE_LICENSE_APACHE2 new file mode 100644 index 0000000..e69de29 diff --git a/MODULE_LICENSE_MIT b/MODULE_LICENSE_MIT deleted file mode 100644 index e69de29..0000000 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>, + ) { self.items.splice( cursor.cursor..cursor.cursor, - insert_items.iter().map(OsString::from), + insert_items.into_iter().map(Into::into), ); } -- cgit v1.2.3