From 72839bb6752f1defff5358fc4645c347e6f39ae4 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Wed, 4 Aug 2021 10:40:33 -0700 Subject: [PATCH 1/2] test(client): fix extra semi-colon warning in helper macro --- tests/client.rs | 4 ++-- tests/support/mod.rs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/client.rs b/tests/client.rs index 3eb6dd9015..a2fdcc0cd9 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -344,11 +344,11 @@ macro_rules! __client_req_prop { } macro_rules! __client_req_header { - ($req_builder:ident, { $($name:expr => $val:expr,)* }) => { + ($req_builder:ident, { $($name:expr => $val:expr,)* }) => {{ $( $req_builder = $req_builder.header($name, $val); )* - } + }} } static REPLY_OK: &str = "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"; diff --git a/tests/support/mod.rs b/tests/support/mod.rs index 56ed839106..6b3c8f4472 100644 --- a/tests/support/mod.rs +++ b/tests/support/mod.rs @@ -177,7 +177,7 @@ macro_rules! __internal_eq_prop { (headers: $map:tt) => {{ #[allow(unused_mut)] { - let mut headers = Vec::new(); + let mut headers = Vec::>::new(); __internal_headers_eq!(headers, $map); headers } @@ -216,12 +216,12 @@ macro_rules! __internal_headers_eq { } }) as std::sync::Arc }; - (@val $name: expr, NONE) => { + (@val $name: expr, NONE) => {{ __internal_headers_eq!(@pat $name, None); - }; - (@val $name: expr, SOME) => { - __internal_headers_eq!(@pat $name, Some(_)); - }; + }}; + (@val $name: expr, SOME) => {{ + __internal_headers_eq!(@pat $name, Some(_)) + }}; (@val $name: expr, $val:expr) => ({ let __val = Option::from($val); std::sync::Arc::new(move |__hdrs: &hyper::HeaderMap| { @@ -232,11 +232,11 @@ macro_rules! __internal_headers_eq { } }) as std::sync::Arc }); - ($headers:ident, { $($name:expr => $val:tt,)* }) => { + ($headers:ident, { $($name:expr => $val:tt,)* }) => {{ $( $headers.push(__internal_headers_eq!(@val $name, $val)); )* - } + }} } #[derive(Clone, Debug)] From a1ac686ea7efa2bcbede8cc4d4dec9a0be99d8be Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Wed, 4 Aug 2021 10:57:23 -0700 Subject: [PATCH 2/2] chore(ffi): update gen_header script to use unpretty option --- capi/gen_header.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/capi/gen_header.sh b/capi/gen_header.sh index a4460c6295..d0b9c13a32 100755 --- a/capi/gen_header.sh +++ b/capi/gen_header.sh @@ -71,7 +71,7 @@ cp "$CAPI_DIR/include/hyper.h" "$header_file_backup" cd "${WORK_DIR}" || exit 2 # Expand just the ffi module -if ! output=$(RUSTFLAGS='--cfg hyper_unstable_ffi' cargo rustc -- -Z unstable-options --pretty=expanded 2>&1 > expanded.rs); then +if ! output=$(RUSTFLAGS='--cfg hyper_unstable_ffi' cargo rustc -- -Z unpretty=expanded 2>&1 > expanded.rs); then # As of April 2021 the script above prints a lot of warnings/errors, and # exits with a nonzero return code, but hyper.h still gets generated. #