macros: Generate certain structs only with client or server feature enabled
If neither the client, nor the server feature is enabled the fields are unused and therefore trigger the dead_code lint.
This commit is contained in:
parent
195091c051
commit
92f862e279
@ -198,6 +198,7 @@ impl Request {
|
||||
|
||||
quote! {
|
||||
/// Data in the request body.
|
||||
#[cfg(any(feature = "client", feature = "server"))]
|
||||
#[derive(Debug, #ruma_macros::_FakeDeriveRumaApi, #ruma_macros::_FakeDeriveSerde)]
|
||||
#[cfg_attr(feature = "client", derive(#serde::Serialize))]
|
||||
#[cfg_attr(
|
||||
@ -225,6 +226,7 @@ impl Request {
|
||||
|
||||
quote! {
|
||||
/// Data in the request's query string.
|
||||
#[cfg(any(feature = "client", feature = "server"))]
|
||||
#[derive(Debug, #ruma_macros::_FakeDeriveRumaApi, #ruma_macros::_FakeDeriveSerde)]
|
||||
#[cfg_attr(feature = "client", derive(#serde::Serialize))]
|
||||
#[cfg_attr(
|
||||
|
@ -100,6 +100,7 @@ impl Response {
|
||||
|
||||
quote! {
|
||||
/// Data in the response body.
|
||||
#[cfg(any(feature = "client", feature = "server"))]
|
||||
#[derive(Debug, #ruma_macros::_FakeDeriveRumaApi, #ruma_macros::_FakeDeriveSerde)]
|
||||
#serde_derives
|
||||
#serde_attr
|
||||
|
Loading…
x
Reference in New Issue
Block a user