aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Vander Stoep <jeffv@google.com>2022-12-12 09:08:35 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-12-12 09:08:35 +0000
commitcfa8836f299ba9ae2a174ade5a5ae007da38f976 (patch)
tree756b4ec1462e264a790e7ad9e6fb03a9bbe66f6e
parent3ce70733cf93f1b59dbd706e7f1da9a5c594f8ae (diff)
parent844b809b54f5c90bf640665914d7bf480c522eed (diff)
downloadenumn-cfa8836f299ba9ae2a174ade5a5ae007da38f976.tar.gz
Merge "Upgrade enumn to 0.1.5" am: 844b809b54
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/enumn/+/2337028 Change-Id: I1cb5d68b8095d609c467a0407d251a965a6cb349 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--.cargo_vcs_info.json7
-rw-r--r--.clippy.toml1
-rw-r--r--.github/workflows/ci.yml23
-rw-r--r--Android.bp2
-rw-r--r--Cargo.toml22
-rw-r--r--Cargo.toml.orig11
-rw-r--r--METADATA13
-rw-r--r--README.md2
-rw-r--r--src/lib.rs8
9 files changed, 67 insertions, 22 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index ea3dd4d..a98c5bd 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,6 @@
{
"git": {
- "sha1": "30565e34c2a6e9ded85d27350b8a6c1e6207eb2c"
- }
-}
+ "sha1": "5fbcf35bdfbffed551726f4c681680e8d4b70e7c"
+ },
+ "path_in_vcs": ""
+} \ No newline at end of file
diff --git a/.clippy.toml b/.clippy.toml
new file mode 100644
index 0000000..3d30690
--- /dev/null
+++ b/.clippy.toml
@@ -0,0 +1 @@
+msrv = "1.31.0"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 385cd8e..2a888ae 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -5,6 +5,9 @@ on:
pull_request:
schedule: [cron: "40 1 * * *"]
+env:
+ RUSTFLAGS: -Dwarnings
+
jobs:
test:
name: Rust ${{matrix.rust}}
@@ -14,8 +17,26 @@ jobs:
matrix:
rust: [nightly, beta, stable, 1.31.0]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- run: cargo test
+
+ clippy:
+ name: Clippy
+ runs-on: ubuntu-latest
+ if: github.event_name != 'pull_request'
+ steps:
+ - uses: actions/checkout@v3
+ - uses: dtolnay/rust-toolchain@clippy
+ - run: cargo clippy -- -Dclippy::all -Dclippy::pedantic
+
+ outdated:
+ name: Outdated
+ runs-on: ubuntu-latest
+ if: github.event_name != 'pull_request'
+ steps:
+ - uses: actions/checkout@v3
+ - uses: dtolnay/install@cargo-outdated
+ - run: cargo outdated --workspace --exit-code 1
diff --git a/Android.bp b/Android.bp
index 63453dc..6f42337 100644
--- a/Android.bp
+++ b/Android.bp
@@ -41,7 +41,7 @@ rust_proc_macro {
name: "libenumn",
crate_name: "enumn",
cargo_env_compat: true,
- cargo_pkg_version: "0.1.3",
+ cargo_pkg_version: "0.1.5",
srcs: ["src/lib.rs"],
edition: "2018",
rustlibs: [
diff --git a/Cargo.toml b/Cargo.toml
index e68e67d..88e0f3e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,28 +3,38 @@
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g., crates.io) dependencies
+# to registry (e.g., crates.io) dependencies.
#
-# If you believe there's an error in this file please file an
-# issue against the rust-lang/cargo repository. If you're
-# editing this file be aware that the upstream Cargo.toml
-# will likely look very different (and much more reasonable)
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
[package]
edition = "2018"
+rust-version = "1.31"
name = "enumn"
-version = "0.1.3"
+version = "0.1.5"
authors = ["David Tolnay <dtolnay@gmail.com>"]
description = "Convert number to enum"
documentation = "https://docs.rs/enumn"
readme = "README.md"
+keywords = [
+ "enum",
+ "integer",
+]
+categories = [
+ "rust-patterns",
+ "no-std",
+]
license = "MIT OR Apache-2.0"
repository = "https://github.com/dtolnay/enumn"
+
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[lib]
proc-macro = true
+
[dependencies.proc-macro2]
version = "1.0"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 938bfe8..eee91e7 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,13 +1,16 @@
[package]
name = "enumn"
-version = "0.1.3"
+version = "0.1.5"
authors = ["David Tolnay <dtolnay@gmail.com>"]
-edition = "2018"
-license = "MIT OR Apache-2.0"
+categories = ["rust-patterns", "no-std"]
description = "Convert number to enum"
-repository = "https://github.com/dtolnay/enumn"
documentation = "https://docs.rs/enumn"
+edition = "2018"
+keywords = ["enum", "integer"]
+license = "MIT OR Apache-2.0"
readme = "README.md"
+repository = "https://github.com/dtolnay/enumn"
+rust-version = "1.31"
[lib]
proc-macro = true
diff --git a/METADATA b/METADATA
index 0cedc69..e5ae64e 100644
--- a/METADATA
+++ b/METADATA
@@ -1,3 +1,7 @@
+# This project was upgraded with external_updater.
+# Usage: tools/external_updater/updater.sh update rust/crates/enumn
+# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md
+
name: "enumn"
description: "Convert number to enum"
third_party {
@@ -7,14 +11,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/enumn/enumn-0.1.3.crate"
+ value: "https://static.crates.io/crates/enumn/enumn-0.1.5.crate"
}
- version: "0.1.3"
- # Dual-licensed, using the least restrictive per go/thirdpartylicenses#same.
+ version: "0.1.5"
license_type: NOTICE
last_upgrade_date {
- year: 2021
+ year: 2022
month: 12
- day: 2
+ day: 9
}
}
diff --git a/README.md b/README.md
index d931a6a..3aa93b5 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@ Convert number to enum
[<img alt="github" src="https://img.shields.io/badge/github-dtolnay/enumn-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="20">](https://github.com/dtolnay/enumn)
[<img alt="crates.io" src="https://img.shields.io/crates/v/enumn.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/enumn)
-[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-enumn-66c2a5?style=for-the-badge&labelColor=555555&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K" height="20">](https://docs.rs/enumn)
+[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-enumn-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" height="20">](https://docs.rs/enumn)
[<img alt="build status" src="https://img.shields.io/github/workflow/status/dtolnay/enumn/CI/master?style=for-the-badge" height="20">](https://github.com/dtolnay/enumn/actions?query=branch%3Amaster)
This crate provides a derive macro to generate a function for converting a
diff --git a/src/lib.rs b/src/lib.rs
index 9639ee2..a62c6e6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,7 +2,7 @@
//!
//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
-//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K
+//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
//!
//! <br>
//!
@@ -105,6 +105,12 @@
//!
//! Here `Letter::n(65)` would return `Some(Letter::A)`.
+#![allow(
+ clippy::missing_panics_doc,
+ clippy::needless_doctest_main,
+ clippy::single_match_else
+)]
+
extern crate proc_macro;
use proc_macro::TokenStream;