Skip to content

Commit b295206

Browse files
authored
Remove #[doc(cfg(...))] attributes (#1554)
This removes all uses of the `#[doc(cfg(...))]` attribute. The purpose of this attribute was to tell `rustdoc` to add an annotation, which would inform users what features an item (module, struct, trait, method, etc.) needed. However, in the latest Nightly, [this attribute is implicit when `#![feature(doc_cfg)]` is enabled][rust-pr]. Thus, our usage of this attribute is unnecessary and we can remove it. [rust-pr]: rust-lang/rust#89596
1 parent 6f87d25 commit b295206

20 files changed

+0
-191
lines changed

src/builder/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,17 @@ mod create_channel;
99
mod create_embed;
1010

1111
#[cfg(feature = "unstable_discord_api")]
12-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
1312
mod create_application_command;
1413
#[cfg(feature = "unstable_discord_api")]
15-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
1614
mod create_application_command_permission;
1715

1816
mod bot_auth_parameters;
1917
mod create_allowed_mentions;
2018
#[cfg(feature = "unstable_discord_api")]
21-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
2219
mod create_components;
2320
#[cfg(feature = "unstable_discord_api")]
24-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
2521
mod create_interaction_response;
2622
#[cfg(feature = "unstable_discord_api")]
27-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
2823
mod create_interaction_response_followup;
2924
mod create_invite;
3025
mod create_message;
@@ -35,7 +30,6 @@ mod edit_guild;
3530
mod edit_guild_welcome_screen;
3631
mod edit_guild_widget;
3732
#[cfg(feature = "unstable_discord_api")]
38-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
3933
mod edit_interaction_response;
4034
mod edit_member;
4135
mod edit_message;
@@ -74,7 +68,6 @@ pub use self::{
7468
get_messages::GetMessages,
7569
};
7670
#[cfg(feature = "unstable_discord_api")]
77-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
7871
pub use self::{
7972
create_application_command::{
8073
CreateApplicationCommand,

src/client/bridge/gateway/shard_messenger.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ impl ShardMessenger {
248248
/// Sets a new filter for an event collector.
249249
#[inline]
250250
#[cfg(feature = "collector")]
251-
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
252251
pub fn set_event_filter(&self, collector: EventFilter) {
253252
#[allow(clippy::let_underscore_must_use)]
254253
let _ = self.send_to_shard(ShardRunnerMessage::SetEventFilter(collector));
@@ -257,23 +256,20 @@ impl ShardMessenger {
257256
/// Sets a new filter for a message collector.
258257
#[inline]
259258
#[cfg(feature = "collector")]
260-
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
261259
pub fn set_message_filter(&self, collector: MessageFilter) {
262260
#[allow(clippy::let_underscore_must_use)]
263261
let _ = self.send_to_shard(ShardRunnerMessage::SetMessageFilter(collector));
264262
}
265263

266264
/// Sets a new filter for a reaction collector.
267265
#[cfg(feature = "collector")]
268-
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
269266
pub fn set_reaction_filter(&self, collector: ReactionFilter) {
270267
#[allow(clippy::let_underscore_must_use)]
271268
let _ = self.send_to_shard(ShardRunnerMessage::SetReactionFilter(collector));
272269
}
273270

274271
/// Sets a new filter for a component interaction collector.
275272
#[cfg(all(feature = "unstable_discord_api", feature = "collector"))]
276-
#[cfg_attr(docsrs, doc(cfg(all(feature = "unstable_discord_api", feature = "collector"))))]
277273
pub fn set_component_interaction_filter(&self, collector: ComponentInteractionFilter) {
278274
#[allow(clippy::let_underscore_must_use)]
279275
let _ = self.send_to_shard(ShardRunnerMessage::SetComponentInteractionFilter(collector));

src/client/bridge/gateway/shard_runner_message.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,14 @@ pub enum ShardRunnerMessage {
6363
SetStatus(OnlineStatus),
6464
/// Sends a new filter for events to the shard.
6565
#[cfg(feature = "collector")]
66-
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
6766
SetEventFilter(EventFilter),
6867
/// Sends a new filter for messages to the shard.
6968
#[cfg(feature = "collector")]
70-
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
7169
SetMessageFilter(MessageFilter),
7270
/// Sends a new filter for reactions to the shard.
7371
#[cfg(feature = "collector")]
74-
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
7572
SetReactionFilter(ReactionFilter),
7673
/// Sends a new filter for component interactions to the shard.
7774
#[cfg(all(feature = "unstable_discord_api", feature = "collector"))]
78-
#[cfg_attr(docsrs, doc(cfg(all(feature = "unstable_discord_api", feature = "collector"))))]
7975
SetComponentInteractionFilter(ComponentInteractionFilter),
8076
}

src/client/context.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ impl Context {
389389
/// sent back to `filter`'s paired receiver.
390390
#[inline]
391391
#[cfg(feature = "collector")]
392-
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
393392
pub async fn set_message_filter(&self, filter: MessageFilter) {
394393
self.shard.set_message_filter(filter);
395394
}
@@ -398,7 +397,6 @@ impl Context {
398397
/// sent back to `filter`'s paired receiver.
399398
#[inline]
400399
#[cfg(feature = "collector")]
401-
#[cfg_attr(docsrs, doc(cfg(feature = "collector")))]
402400
pub async fn set_reaction_filter(&self, filter: ReactionFilter) {
403401
self.shard.set_reaction_filter(filter);
404402
}
@@ -407,7 +405,6 @@ impl Context {
407405
/// sent back to `filter`'s paired receiver.
408406
#[inline]
409407
#[cfg(all(feature = "unstable_discord_api", feature = "collector"))]
410-
#[cfg_attr(docsrs, doc(cfg(all(feature = "unstable_discord_api", feature = "collector"))))]
411408
pub async fn set_component_interaction_filter(&self, filter: ComponentInteractionFilter) {
412409
self.shard.set_component_interaction_filter(filter);
413410
}

src/client/event_handler.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -428,28 +428,24 @@ pub trait EventHandler: Send + Sync {
428428
///
429429
/// Provides the created interaction.
430430
#[cfg(feature = "unstable_discord_api")]
431-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
432431
async fn interaction_create(&self, _ctx: Context, _interaction: Interaction) {}
433432

434433
/// Dispatched when a guild integration is created.
435434
///
436435
/// Provides the created integration.
437436
#[cfg(feature = "unstable_discord_api")]
438-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
439437
async fn integration_create(&self, _ctx: Context, _integration: Integration) {}
440438

441439
/// Dispatched when a guild integration is updated.
442440
///
443441
/// Provides the updated integration.
444442
#[cfg(feature = "unstable_discord_api")]
445-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
446443
async fn integration_update(&self, _ctx: Context, _integration: Integration) {}
447444

448445
/// Dispatched when a guild integration is deleted.
449446
///
450447
/// Provides the integration's id, the id of the guild it belongs to, and its associated application id
451448
#[cfg(feature = "unstable_discord_api")]
452-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
453449
async fn integration_delete(
454450
&self,
455451
_ctx: Context,
@@ -463,7 +459,6 @@ pub trait EventHandler: Send + Sync {
463459
///
464460
/// Provides the created application command.
465461
#[cfg(feature = "unstable_discord_api")]
466-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
467462
async fn application_command_create(
468463
&self,
469464
_ctx: Context,
@@ -475,7 +470,6 @@ pub trait EventHandler: Send + Sync {
475470
///
476471
/// Provides the updated application command.
477472
#[cfg(feature = "unstable_discord_api")]
478-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
479473
async fn application_command_update(
480474
&self,
481475
_ctx: Context,
@@ -487,7 +481,6 @@ pub trait EventHandler: Send + Sync {
487481
///
488482
/// Provides the deleted application command.
489483
#[cfg(feature = "unstable_discord_api")]
490-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
491484
async fn application_command_delete(
492485
&self,
493486
_ctx: Context,

src/http/client.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,6 @@ impl Http {
447447
///
448448
/// Functions the same as [`Self::execute_webhook`]
449449
#[cfg(feature = "unstable_discord_api")]
450-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
451450
pub async fn create_followup_message(
452451
&self,
453452
interaction_token: &str,
@@ -476,7 +475,6 @@ impl Http {
476475
///
477476
/// [docs]: https://discord.com/developers/docs/interactions/slash-commands#create-global-application-command
478477
#[cfg(feature = "unstable_discord_api")]
479-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
480478
pub async fn create_global_application_command(
481479
&self,
482480
map: &Value,
@@ -493,7 +491,6 @@ impl Http {
493491

494492
/// Creates new global application commands.
495493
#[cfg(feature = "unstable_discord_api")]
496-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
497494
pub async fn create_global_application_commands(
498495
&self,
499496
map: &Value,
@@ -510,7 +507,6 @@ impl Http {
510507

511508
/// Creates new guild application commands.
512509
#[cfg(feature = "unstable_discord_api")]
513-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
514510
pub async fn create_guild_application_commands(
515511
&self,
516512
guild_id: u64,
@@ -579,7 +575,6 @@ impl Http {
579575
///
580576
/// [docs]: https://discord.com/developers/docs/interactions/slash-commands#create-guild-application-command
581577
#[cfg(feature = "unstable_discord_api")]
582-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
583578
pub async fn create_guild_application_command(
584579
&self,
585580
guild_id: u64,
@@ -627,7 +622,6 @@ impl Http {
627622
///
628623
/// [docs]: https://discord.com/developers/docs/interactions/slash-commands#interaction-interaction-response
629624
#[cfg(feature = "unstable_discord_api")]
630-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
631625
pub async fn create_interaction_response(
632626
&self,
633627
interaction_id: u64,
@@ -823,7 +817,6 @@ impl Http {
823817

824818
/// Deletes a follow-up message for an interaction.
825819
#[cfg(feature = "unstable_discord_api")]
826-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
827820
pub async fn delete_followup_message(
828821
&self,
829822
interaction_token: &str,
@@ -843,7 +836,6 @@ impl Http {
843836

844837
/// Deletes a global command.
845838
#[cfg(feature = "unstable_discord_api")]
846-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
847839
pub async fn delete_global_application_command(&self, command_id: u64) -> Result<()> {
848840
self.wind(204, Request {
849841
body: None,
@@ -870,7 +862,6 @@ impl Http {
870862

871863
/// Deletes a guild command.
872864
#[cfg(feature = "unstable_discord_api")]
873-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
874865
pub async fn delete_guild_application_command(
875866
&self,
876867
guild_id: u64,
@@ -990,7 +981,6 @@ impl Http {
990981

991982
/// Deletes the initial interaction response.
992983
#[cfg(feature = "unstable_discord_api")]
993-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
994984
pub async fn delete_original_interaction_response(
995985
&self,
996986
interaction_token: &str,
@@ -1168,7 +1158,6 @@ impl Http {
11681158
///
11691159
/// [docs]: https://discord.com/developers/docs/resources/webhook#edit-webhook-message
11701160
#[cfg(feature = "unstable_discord_api")]
1171-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
11721161
pub async fn edit_followup_message(
11731162
&self,
11741163
interaction_token: &str,
@@ -1195,7 +1184,6 @@ impl Http {
11951184
///
11961185
/// [docs]: https://discord.com/developers/docs/interactions/slash-commands#edit-global-application-command
11971186
#[cfg(feature = "unstable_discord_api")]
1198-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
11991187
pub async fn edit_global_application_command(
12001188
&self,
12011189
command_id: u64,
@@ -1234,7 +1222,6 @@ impl Http {
12341222
///
12351223
/// [docs]: https://discord.com/developers/docs/interactions/slash-commands#edit-guild-application-command
12361224
#[cfg(feature = "unstable_discord_api")]
1237-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
12381225
pub async fn edit_guild_application_command(
12391226
&self,
12401227
guild_id: u64,
@@ -1261,7 +1248,6 @@ impl Http {
12611248
///
12621249
/// [documentation]: https://discord.com/developers/docs/interactions/slash-commands#edit-guild-application-command
12631250
#[cfg(feature = "unstable_discord_api")]
1264-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
12651251
pub async fn edit_guild_application_command_permissions(
12661252
&self,
12671253
guild_id: u64,
@@ -1288,7 +1274,6 @@ impl Http {
12881274
///
12891275
/// [documentation]: https://discord.com/developers/docs/interactions/slash-commands#edit-guild-application-command
12901276
#[cfg(feature = "unstable_discord_api")]
1291-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
12921277
pub async fn edit_guild_application_commands_permissions(
12931278
&self,
12941279
guild_id: u64,
@@ -1445,7 +1430,6 @@ impl Http {
14451430

14461431
/// Gets the initial interaction response.
14471432
#[cfg(feature = "unstable_discord_api")]
1448-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
14491433
pub async fn get_original_interaction_response(
14501434
&self,
14511435
interaction_token: &str,
@@ -1467,7 +1451,6 @@ impl Http {
14671451
///
14681452
/// [docs]: https://discord.com/developers/docs/resources/webhook#edit-webhook-message
14691453
#[cfg(feature = "unstable_discord_api")]
1470-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
14711454
pub async fn edit_original_interaction_response(
14721455
&self,
14731456
interaction_token: &str,
@@ -2311,7 +2294,6 @@ impl Http {
23112294

23122295
/// Fetches all of the global commands for your application.
23132296
#[cfg(feature = "unstable_discord_api")]
2314-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
23152297
pub async fn get_global_application_commands(&self) -> Result<Vec<ApplicationCommand>> {
23162298
self.fire(Request {
23172299
body: None,
@@ -2325,7 +2307,6 @@ impl Http {
23252307

23262308
/// Fetches a global commands for your application by its Id.
23272309
#[cfg(feature = "unstable_discord_api")]
2328-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
23292310
pub async fn get_global_application_command(
23302311
&self,
23312312
command_id: u64,
@@ -2367,7 +2348,6 @@ impl Http {
23672348

23682349
/// Fetches all of the guild commands for your application for a specific guild.
23692350
#[cfg(feature = "unstable_discord_api")]
2370-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
23712351
pub async fn get_guild_application_commands(
23722352
&self,
23732353
guild_id: u64,
@@ -2385,7 +2365,6 @@ impl Http {
23852365

23862366
/// Fetches a guild command by its Id.
23872367
#[cfg(feature = "unstable_discord_api")]
2388-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
23892368
pub async fn get_guild_application_command(
23902369
&self,
23912370
guild_id: u64,
@@ -2405,7 +2384,6 @@ impl Http {
24052384

24062385
/// Fetches all of the guild commands permissions for your application for a specific guild.
24072386
#[cfg(feature = "unstable_discord_api")]
2408-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
24092387
pub async fn get_guild_application_commands_permissions(
24102388
&self,
24112389
guild_id: u64,
@@ -2423,7 +2401,6 @@ impl Http {
24232401

24242402
/// Gives the guild command permission for your application for a specific guild.
24252403
#[cfg(feature = "unstable_discord_api")]
2426-
#[cfg_attr(docsrs, doc(cfg(feature = "unstable_discord_api")))]
24272404
pub async fn get_guild_application_command_permissions(
24282405
&self,
24292406
guild_id: u64,

0 commit comments

Comments
 (0)