diff options
author | Joel Galenson <jgalenson@google.com> | 2021-08-11 15:28:47 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-08-11 15:28:47 +0000 |
commit | 984934814965d7e69ceb50b74663ef76007b5d03 (patch) | |
tree | 38cb32968d3a4be212275d8d40843d7eedb92a7f | |
parent | ed6f6c0e7c3ec39fdf66b595d06404144a45a581 (diff) | |
parent | 180719c6155169f692cb8577777cdd4d3861cd7f (diff) | |
download | tokio-macros-984934814965d7e69ceb50b74663ef76007b5d03.tar.gz |
Upgrade rust/crates/tokio-macros to 1.3.0 am: b92cb37d81 am: 9807332c20 am: ce666e5a9f am: 60375c525a am: 180719c615
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tokio-macros/+/1791042
Change-Id: I7e051b624b907fce91aa29086b0db45bc6c1dac5
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 20 | ||||
-rw-r--r-- | CHANGELOG.md | 6 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | Cargo.toml.orig | 4 | ||||
-rw-r--r-- | METADATA | 8 | ||||
-rw-r--r-- | src/entry.rs | 30 | ||||
-rw-r--r-- | src/lib.rs | 2 |
8 files changed, 42 insertions, 34 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 6934779..65c26b2 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "3a659c47c33f0d8ccdebbdce320610dc8814fae0" + "sha1": "c505a2f81aa7a73d95bd2b0c56a5a5205054656e" } } @@ -52,23 +52,23 @@ rust_test_host { // autocfg-1.0.1 // bytes-1.0.1 "default,std" // cfg-if-1.0.0 -// instant-0.1.9 -// libc-0.2.94 "default,std" +// instant-0.1.10 +// libc-0.2.98 "default,std" // lock_api-0.4.4 // log-0.4.14 // memchr-2.4.0 "default,std" -// mio-0.7.11 "default,net,os-ext,os-poll,os-util,tcp,udp,uds" +// mio-0.7.13 "default,net,os-ext,os-poll,os-util,tcp,udp,uds" // num_cpus-1.13.0 -// once_cell-1.7.2 "alloc,default,race,std" +// once_cell-1.8.0 "alloc,default,race,std" // parking_lot-0.11.1 "default" // parking_lot_core-0.8.3 -// pin-project-lite-0.2.6 -// proc-macro2-1.0.26 "default,proc-macro" +// pin-project-lite-0.2.7 +// proc-macro2-1.0.28 "default,proc-macro" // quote-1.0.9 "default,proc-macro" // scopeguard-1.1.0 -// signal-hook-registry-1.3.0 +// signal-hook-registry-1.4.0 // smallvec-1.6.1 -// syn-1.0.72 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote" -// tokio-1.6.0 "bytes,default,fs,full,io-std,io-util,libc,macros,memchr,mio,net,num_cpus,once_cell,parking_lot,process,rt,rt-multi-thread,signal,signal-hook-registry,sync,time,tokio-macros,winapi" -// tokio-macros-1.2.0 +// syn-1.0.74 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote" +// tokio-1.9.0 "bytes,default,fs,full,io-std,io-util,libc,macros,memchr,mio,net,num_cpus,once_cell,parking_lot,process,rt,rt-multi-thread,signal,signal-hook-registry,sync,time,tokio-macros,winapi" +// tokio-macros-1.3.0 // unicode-xid-0.2.2 "default" diff --git a/CHANGELOG.md b/CHANGELOG.md index 6df34c0..0d58f97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.3.0 (July 7, 2021) + +- macros: don't trigger `clippy::unwrap_used` ([#3926]) + +[#3926]: https://github.com/tokio-rs/tokio/pull/3926 + # 1.2.0 (May 14, 2021) - macros: forward input arguments in `#[tokio::test]` ([#3691]) @@ -13,11 +13,11 @@ [package] edition = "2018" name = "tokio-macros" -version = "1.2.0" +version = "1.3.0" authors = ["Tokio Contributors <team@tokio.rs>"] description = "Tokio's proc macros.\n" homepage = "https://tokio.rs" -documentation = "https://docs.rs/tokio-macros/1.2.0/tokio_macros" +documentation = "https://docs.rs/tokio-macros/1.3.0/tokio_macros" categories = ["asynchronous"] license = "MIT" repository = "https://github.com/tokio-rs/tokio" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 875ceb6..5399bc6 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -6,13 +6,13 @@ name = "tokio-macros" # - Cargo.toml # - Update CHANGELOG.md. # - Create "tokio-macros-1.0.x" git tag. -version = "1.2.0" +version = "1.3.0" edition = "2018" authors = ["Tokio Contributors <team@tokio.rs>"] license = "MIT" repository = "https://github.com/tokio-rs/tokio" homepage = "https://tokio.rs" -documentation = "https://docs.rs/tokio-macros/1.2.0/tokio_macros" +documentation = "https://docs.rs/tokio-macros/1.3.0/tokio_macros" description = """ Tokio's proc macros. """ @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/tokio-macros/tokio-macros-1.2.0.crate" + value: "https://static.crates.io/crates/tokio-macros/tokio-macros-1.3.0.crate" } - version: "1.2.0" + version: "1.3.0" license_type: NOTICE last_upgrade_date { year: 2021 - month: 5 - day: 19 + month: 8 + day: 9 } } diff --git a/src/entry.rs b/src/entry.rs index ddc1958..c5db13c 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -201,12 +201,15 @@ fn parse_knobs( for arg in args { match arg { syn::NestedMeta::Meta(syn::Meta::NameValue(namevalue)) => { - let ident = namevalue.path.get_ident(); - if ident.is_none() { - let msg = "Must have specified ident"; - return Err(syn::Error::new_spanned(namevalue, msg)); - } - match ident.unwrap().to_string().to_lowercase().as_str() { + let ident = namevalue + .path + .get_ident() + .ok_or_else(|| { + syn::Error::new_spanned(&namevalue, "Must have specified ident") + })? + .to_string() + .to_lowercase(); + match ident.as_str() { "worker_threads" => { config.set_worker_threads( namevalue.lit.clone(), @@ -239,12 +242,11 @@ fn parse_knobs( } } syn::NestedMeta::Meta(syn::Meta::Path(path)) => { - let ident = path.get_ident(); - if ident.is_none() { - let msg = "Must have specified ident"; - return Err(syn::Error::new_spanned(path, msg)); - } - let name = ident.unwrap().to_string().to_lowercase(); + let name = path + .get_ident() + .ok_or_else(|| syn::Error::new_spanned(&path, "Must have specified ident"))? + .to_string() + .to_lowercase(); let msg = match name.as_str() { "threaded_scheduler" | "multi_thread" => { format!( @@ -326,11 +328,11 @@ fn parse_knobs( #rt .enable_all() .build() - .unwrap() + .expect("Failed building the Runtime") .block_on(async #body) } }) - .unwrap(); + .expect("Parsing failure"); input.block.brace_token = brace_token; let result = quote! { @@ -5,7 +5,7 @@ rust_2018_idioms, unreachable_pub )] -#![cfg_attr(docsrs, deny(broken_intra_doc_links))] +#![cfg_attr(docsrs, deny(rustdoc::broken_intra_doc_links))] #![doc(test( no_crate_inject, attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables)) |