Skip to content

Commit

Permalink
Remove redundant internal prelude imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrasnitski committed Sep 13, 2024
1 parent 1f23dda commit 5036b41
Show file tree
Hide file tree
Showing 36 changed files with 14 additions and 103 deletions.
13 changes: 1 addition & 12 deletions src/model/application/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,7 @@ use super::{InstallationContext, InteractionContext};
use crate::builder::CreateCommand;
#[cfg(feature = "model")]
use crate::http::Http;
use crate::internal::prelude::*;
use crate::model::channel::ChannelType;
use crate::model::id::{
ApplicationId,
CommandId,
CommandPermissionId,
CommandVersionId,
GuildId,
RoleId,
UserId,
};
use crate::model::Permissions;
use crate::model::prelude::*;

/// The base command model that belongs to an application.
///
Expand Down
21 changes: 1 addition & 20 deletions src/model/application/command_interaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,8 @@ use crate::builder::{
use crate::gateway::client::Context;
#[cfg(feature = "model")]
use crate::http::Http;
use crate::internal::prelude::*;
use crate::internal::utils::lending_for_each;
use crate::model::application::{CommandOptionType, CommandType};
use crate::model::channel::{Attachment, Message, PartialChannel};
use crate::model::guild::{Member, PartialMember, Role};
use crate::model::id::{
ApplicationId,
AttachmentId,
ChannelId,
CommandId,
GenericId,
GuildId,
InteractionId,
MessageId,
RoleId,
TargetId,
UserId,
};
use crate::model::monetization::Entitlement;
use crate::model::user::User;
use crate::model::Permissions;
use crate::model::prelude::*;
#[cfg(all(feature = "collector", feature = "utils"))]
use crate::utils::{CreateQuickModal, QuickModalResponse};

Expand Down
1 change: 0 additions & 1 deletion src/model/application/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use serde::de::Error as DeError;
use serde::ser::{Serialize, Serializer};
use serde_json::from_value;

use crate::internal::prelude::*;
use crate::model::prelude::*;
use crate::model::utils::{default_true, deserialize_val};

Expand Down
1 change: 0 additions & 1 deletion src/model/application/component_interaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use crate::builder::{
use crate::gateway::client::Context;
#[cfg(feature = "model")]
use crate::http::Http;
use crate::internal::prelude::*;
use crate::model::prelude::*;
#[cfg(all(feature = "collector", feature = "utils"))]
use crate::utils::{CreateQuickModal, QuickModalResponse};
Expand Down
6 changes: 1 addition & 5 deletions src/model/application/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ pub use oauth::*;
mod ping_interaction;
pub use ping_interaction::*;

use super::id::{ApplicationId, GenericId, GuildId, SkuId, UserId};
use super::misc::ImageHash;
use super::user::User;
use super::Permissions;
use crate::internal::prelude::*;
use super::prelude::*;

/// Partial information about the given application.
///
Expand Down
1 change: 0 additions & 1 deletion src/model/application/modal_interaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::builder::{
};
#[cfg(feature = "model")]
use crate::http::Http;
use crate::internal::prelude::*;
use crate::model::prelude::*;

/// An interaction triggered by a modal submit.
Expand Down
3 changes: 1 addition & 2 deletions src/model/application/ping_interaction.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use serde::{Deserialize, Serialize};

use crate::internal::prelude::*;
use crate::model::id::{ApplicationId, InteractionId};
use crate::model::prelude::*;

/// A ping interaction, which can only be received through an endpoint url.
///
Expand Down
1 change: 0 additions & 1 deletion src/model/channel/attachment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use nonmax::NonMaxU32;
use reqwest::Client as ReqwestClient;
use serde_cow::CowStr;

use crate::internal::prelude::*;
use crate::model::prelude::*;
use crate::model::utils::is_false;

Expand Down
3 changes: 1 addition & 2 deletions src/model/channel/embed.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use nonmax::NonMaxU32;

use crate::internal::prelude::*;
use crate::model::{Colour, Timestamp};
use crate::model::prelude::*;

/// Represents a rich embed which allows using richer markdown, multiple fields and more. This was
/// heavily inspired by [slack's attachments].
Expand Down
1 change: 0 additions & 1 deletion src/model/channel/guild_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use crate::collector::{MessageCollector, ReactionCollector};
use crate::gateway::ShardMessenger;
#[cfg(feature = "model")]
use crate::http::{CacheHttp, Http, Typing};
use crate::internal::prelude::*;
use crate::model::prelude::*;

/// Represents a guild's text, news, or voice channel. Some methods are available only for voice
Expand Down
1 change: 0 additions & 1 deletion src/model/channel/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use crate::constants;
use crate::gateway::ShardMessenger;
#[cfg(feature = "model")]
use crate::http::{CacheHttp, Http};
use crate::internal::prelude::*;
use crate::model::prelude::*;
use crate::model::utils::{discord_colours, StrOrInt};

Expand Down
1 change: 0 additions & 1 deletion src/model/channel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pub use self::private_channel::*;
pub use self::reaction::*;
#[cfg(feature = "model")]
use crate::http::Http;
use crate::internal::prelude::*;
use crate::model::prelude::*;
use crate::model::utils::is_false;

Expand Down
5 changes: 1 addition & 4 deletions src/model/channel/partial_channel.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use crate::internal::prelude::*;
use crate::model::channel::{ChannelType, ThreadMetadata};
use crate::model::id::{ChannelId, WebhookId};
use crate::model::Permissions;
use crate::model::prelude::*;

/// A container for any partial channel.
///
Expand Down
1 change: 0 additions & 1 deletion src/model/channel/reaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use tracing::warn;

#[cfg(feature = "model")]
use crate::http::{CacheHttp, Http};
use crate::internal::prelude::*;
use crate::model::prelude::*;
use crate::model::utils::discord_colours_opt;

Expand Down
1 change: 0 additions & 1 deletion src/model/connection.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Models for user connections.

use super::prelude::*;
use crate::internal::prelude::*;

/// Information about a connection between the current user and a third party service.
///
Expand Down
1 change: 0 additions & 1 deletion src/model/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use strum::{EnumCount, IntoStaticStr, VariantNames};
use tracing::{debug, warn};

use crate::constants::Opcode;
use crate::internal::prelude::*;
use crate::internal::utils::lending_for_each;
use crate::model::prelude::*;
use crate::model::utils::deserialize_val;
Expand Down
1 change: 0 additions & 1 deletion src/model/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use url::Url;

use super::prelude::*;
use super::utils::*;
use crate::internal::prelude::*;

/// A representation of the data retrieved from the bot gateway endpoint.
///
Expand Down
18 changes: 2 additions & 16 deletions src/model/guild/audit_log/change.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
use nonmax::NonMaxU16;

use crate::internal::prelude::*;
use crate::model::channel::PermissionOverwrite;
use crate::model::guild::automod::{Action, EventType, TriggerMetadata, TriggerType};
use crate::model::guild::{
AfkTimeout,
DefaultMessageNotificationLevel,
ExplicitContentFilter,
MfaLevel,
SystemChannelFlags,
VerificationLevel,
};
use crate::model::id::{ApplicationId, ChannelId, GenericId, GuildId, RoleId, UserId};
use crate::model::misc::ImageHash;
use crate::model::sticker::StickerFormatType;
use crate::model::prelude::*;
use crate::model::utils::StrOrInt;
use crate::model::{Permissions, Timestamp};

#[cfg_attr(feature = "typesize", derive(typesize::derive::TypeSize))]
#[derive(Debug, PartialEq, Eq, Deserialize, Serialize, Clone)]
Expand Down Expand Up @@ -165,7 +151,7 @@ generate_change! {
"enable_emoticons" => EnableEmoticons(bool),
/// Entity type of guild scheduled event was changed.
"entity_type" => EntityType(u64),
"event_type" => EventType(EventType),
"event_type" => EventType(AutomodEventType),
"exempt_channels" => ExemptChannels(FixedArray<ChannelId>),
"exempt_roles" => ExemptRoles(FixedArray<RoleId>),
/// Behavior of the expiration of an integration was changed.
Expand Down
1 change: 0 additions & 1 deletion src/model/guild/audit_log/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ mod utils;
pub use change::{AffectedRole, Change, EntityType};
use utils::optional_string;

use crate::internal::prelude::*;
use crate::model::prelude::*;

/// Determines the action that was done on a target.
Expand Down
3 changes: 1 addition & 2 deletions src/model/guild/automod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ use serde::de::{Deserializer, Error};
use serde::ser::Serializer;
use serde::{Deserialize, Serialize};

use crate::internal::prelude::*;
use crate::model::id::*;
use crate::model::prelude::*;

/// Configured auto moderation rule.
///
Expand Down
4 changes: 1 addition & 3 deletions src/model/guild/emoji.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use std::fmt;

use crate::internal::prelude::*;
use crate::model::id::{EmojiId, RoleId};
use crate::model::user::User;
use crate::model::prelude::*;
use crate::model::utils::default_true;

/// Represents a custom guild emoji, which can either be created using the API, or via an
Expand Down
2 changes: 0 additions & 2 deletions src/model/guild/guild_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ use crate::gateway::ShardMessenger;
#[cfg(feature = "model")]
use crate::http::{CacheHttp, Http, UserPagination};
#[cfg(feature = "model")]
use crate::internal::prelude::*;
#[cfg(feature = "model")]
use crate::model::error::Maximum;
use crate::model::prelude::*;

Expand Down
6 changes: 1 addition & 5 deletions src/model/guild/guild_preview.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
use crate::internal::prelude::*;
use crate::model::guild::Emoji;
use crate::model::id::GuildId;
use crate::model::misc::ImageHash;
use crate::model::sticker::Sticker;
use crate::model::prelude::*;

/// Preview [`Guild`] information.
///
Expand Down
1 change: 0 additions & 1 deletion src/model/guild/member.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::builder::EditMember;
use crate::cache::Cache;
#[cfg(feature = "model")]
use crate::http::Http;
use crate::internal::prelude::*;
use crate::model::prelude::*;
#[cfg(feature = "model")]
use crate::model::utils::avatar_url;
Expand Down
1 change: 0 additions & 1 deletion src/model/guild/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ use crate::constants::LARGE_THRESHOLD;
use crate::gateway::ShardMessenger;
#[cfg(feature = "model")]
use crate::http::{CacheHttp, Http, UserPagination};
use crate::internal::prelude::*;
use crate::model::prelude::*;
#[cfg(feature = "model")]
use crate::model::utils::*;
Expand Down
1 change: 0 additions & 1 deletion src/model/guild/partial_guild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use crate::collector::{MessageCollector, ReactionCollector};
use crate::gateway::ShardMessenger;
#[cfg(feature = "model")]
use crate::http::{CacheHttp, Http, UserPagination};
use crate::internal::prelude::*;
use crate::internal::utils::lending_for_each;
use crate::model::prelude::*;
#[cfg(feature = "model")]
Expand Down
1 change: 0 additions & 1 deletion src/model/guild/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::fmt;
use crate::builder::EditRole;
#[cfg(feature = "model")]
use crate::http::Http;
use crate::internal::prelude::*;
use crate::model::prelude::*;
use crate::model::utils::is_false;

Expand Down
1 change: 0 additions & 1 deletion src/model/guild/scheduled_event.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use nonmax::NonMaxU64;

use crate::internal::prelude::*;
use crate::model::prelude::*;

/// Information about a guild scheduled event.
Expand Down
3 changes: 1 addition & 2 deletions src/model/guild/welcome_screen.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use serde::{Deserialize, Deserializer, Serialize, Serializer};

use crate::internal::prelude::*;
use crate::model::id::{ChannelId, EmojiId};
use crate::model::prelude::*;

/// Information relating to a guild's welcome screen.
///
Expand Down
3 changes: 1 addition & 2 deletions src/model/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use std::fmt;

use nonmax::NonMaxU64;

use super::Timestamp;
use crate::internal::prelude::*;
use super::prelude::*;

macro_rules! newtype_display_impl {
($name:ident) => {
Expand Down
1 change: 0 additions & 1 deletion src/model/invite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use super::prelude::*;
use crate::builder::CreateInvite;
#[cfg(feature = "model")]
use crate::http::Http;
use crate::internal::prelude::*;

/// Information about an invite code.
///
Expand Down
1 change: 0 additions & 1 deletion src/model/sticker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
use crate::builder::EditSticker;
#[cfg(feature = "model")]
use crate::http::Http;
use crate::internal::prelude::*;
use crate::model::prelude::*;
use crate::model::utils::comma_separated_string;

Expand Down
1 change: 0 additions & 1 deletion src/model/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use crate::collector::{MessageCollector, ReactionCollector};
use crate::gateway::ShardMessenger;
#[cfg(feature = "model")]
use crate::http::{CacheHttp, Http};
use crate::internal::prelude::*;
#[cfg(feature = "model")]
use crate::model::utils::avatar_url;

Expand Down
1 change: 0 additions & 1 deletion src/model/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use serde_cow::CowStr;
use small_fixed_array::FixedString;

use super::prelude::*;
use crate::internal::prelude::*;

pub fn default_true() -> bool {
true
Expand Down
5 changes: 1 addition & 4 deletions src/model/voice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
use serde::de::{Deserialize, Deserializer};
use serde::Serialize;

use crate::internal::prelude::*;
use crate::model::guild::Member;
use crate::model::id::{ChannelId, GuildId, UserId};
use crate::model::Timestamp;
use crate::model::prelude::*;

/// Information about an available voice region.
///
Expand Down
1 change: 0 additions & 1 deletion src/model/webhook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::builder::{EditWebhook, EditWebhookMessage, ExecuteWebhook};
use crate::cache::{Cache, GuildRef};
#[cfg(feature = "model")]
use crate::http::{CacheHttp, Http};
use crate::internal::prelude::*;
use crate::model::prelude::*;

enum_number! {
Expand Down

0 comments on commit 5036b41

Please sign in to comment.