From c980644d77c6bc46255cc1219708540564a6befd Mon Sep 17 00:00:00 2001 From: Devin Ragotzy Date: Wed, 5 Aug 2020 17:46:53 -0400 Subject: [PATCH] Clean up and fix missing comma for request query map --- ruma-api-macros/src/api.rs | 6 +++--- ruma-api/tests/outgoing.rs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ruma-api-macros/src/api.rs b/ruma-api-macros/src/api.rs index 0a0f6eef..8fd550a3 100644 --- a/ruma-api-macros/src/api.rs +++ b/ruma-api-macros/src/api.rs @@ -126,7 +126,7 @@ impl ToTokens for Api { let field_name = field.ident.as_ref().expect("expected field to have an identifier"); quote! { - #field_name: request_query + #field_name: request_query, } } else { self.request.request_init_query_fields() @@ -247,10 +247,10 @@ impl ToTokens for Api { let api = quote! { // FIXME: These can't conflict with other imports, but it would still be nice not to // bring anything into scope that code outside the macro could then rely on. - // use ::std::convert::TryInto as _; + use ::std::convert::TryInto as _; use ::ruma_api::exports::serde::de::Error as _; - // use ::ruma_api::exports::serde::Deserialize as _; + use ::ruma_api::exports::serde::Deserialize as _; use ::ruma_api::Endpoint as _; #[doc = #request_doc] diff --git a/ruma-api/tests/outgoing.rs b/ruma-api/tests/outgoing.rs index 39be4170..9d7d609a 100644 --- a/ruma-api/tests/outgoing.rs +++ b/ruma-api/tests/outgoing.rs @@ -36,6 +36,7 @@ pub struct FakeRequest<'a, T> { pub bytes: &'a [u8], pub recursive: &'a [Thing<'a, T>], pub option: Option<&'a [u8]>, + pub depth: Option<&'a [(&'a str, &'a str)]>, } #[derive(Outgoing)]