diff --git a/src/model/application/command.rs b/src/model/application/command.rs index 511f21cb8d7..62eb0af6f5b 100644 --- a/src/model/application/command.rs +++ b/src/model/application/command.rs @@ -54,13 +54,13 @@ pub struct Command { /// ([source](https://discord.com/developers/docs/interactions/application-commands#retrieving-localized-commands)). pub name_localizations: Option>, /// The command description. - pub description: FixedString, + pub description: FixedString, /// The localized command description of the selected locale. /// /// If the description is localized, either this field or [`Self::description_localizations`] /// is set, depending on which endpoint this data was retrieved from /// ([source](https://discord.com/developers/docs/interactions/application-commands#retrieving-localized-commands)). - pub description_localized: Option>, + pub description_localized: Option>, /// All localized command descriptions. /// /// If the description is localized, either this field or [`Self::description_localized`] is diff --git a/src/model/application/component.rs b/src/model/application/component.rs index 91a1d9e297e..6c6887aae8d 100644 --- a/src/model/application/component.rs +++ b/src/model/application/component.rs @@ -247,7 +247,7 @@ pub struct InputText { #[serde(rename = "type")] pub kind: ComponentType, /// Developer-defined identifier for the input; max 100 characters - pub custom_id: FixedString, + pub custom_id: FixedString, /// The [`InputTextStyle`]. Required when sending modal data. /// /// Discord docs are wrong here; it says the field is always sent in modal submit interactions @@ -276,7 +276,7 @@ pub struct InputText { pub value: Option>, /// Custom placeholder text if the input is empty; max 100 characters #[serde(skip_serializing_if = "Option::is_none")] - pub placeholder: Option>, + pub placeholder: Option>, } enum_number! { diff --git a/src/model/channel/channel_id.rs b/src/model/channel/channel_id.rs index 60752d417ab..f12dc78bc1f 100644 --- a/src/model/channel/channel_id.rs +++ b/src/model/channel/channel_id.rs @@ -531,11 +531,11 @@ impl ChannelId { /// # Errors /// /// Same as [`Self::to_channel()`]. - pub async fn name(self, cache_http: impl CacheHttp) -> Result> { + pub async fn name(self, cache_http: impl CacheHttp) -> Result { let channel = self.to_channel(cache_http).await?; Ok(match channel { - Channel::Guild(channel) => channel.name, + Channel::Guild(channel) => channel.name.into(), Channel::Private(channel) => channel.name(), }) } diff --git a/src/model/channel/guild_channel.rs b/src/model/channel/guild_channel.rs index ce074dd3c1c..27cfa2cefec 100644 --- a/src/model/channel/guild_channel.rs +++ b/src/model/channel/guild_channel.rs @@ -72,7 +72,7 @@ pub struct GuildChannel { /// **Note**: This is only available for text channels. pub last_pin_timestamp: Option, /// The name of the channel. (1-100 characters) - pub name: FixedString, + pub name: FixedString, /// Permission overwrites for [`Member`]s and for [`Role`]s. #[serde(default)] pub permission_overwrites: FixedArray, diff --git a/src/model/channel/private_channel.rs b/src/model/channel/private_channel.rs index cf18664a5c5..c053f1d9efc 100644 --- a/src/model/channel/private_channel.rs +++ b/src/model/channel/private_channel.rs @@ -200,8 +200,8 @@ impl PrivateChannel { /// Returns "DM with $username#discriminator". #[must_use] - pub fn name(&self) -> FixedString { - format!("DM with {}", self.recipient.tag()).into() + pub fn name(&self) -> String { + format!("DM with {}", self.recipient.tag()) } /// Gets the list of [`User`]s who have reacted to a [`Message`] with a certain [`Emoji`]. diff --git a/src/model/guild/automod.rs b/src/model/guild/automod.rs index 7c2ab6f722e..1892d6af38b 100644 --- a/src/model/guild/automod.rs +++ b/src/model/guild/automod.rs @@ -331,7 +331,7 @@ pub enum Action { /// Additional explanation that will be shown to members whenever their message is blocked /// /// Maximum of 150 characters - custom_message: Option>, + custom_message: Option>, }, /// Logs user content to a specified channel. Alert(ChannelId), @@ -401,7 +401,7 @@ struct RawActionMetadata { #[serde(skip_serializing_if = "Option::is_none")] duration_seconds: Option, #[serde(skip_serializing_if = "Option::is_none")] - custom_message: Option>, + custom_message: Option>, } /// Helper struct for the (de)serialization of `Action`. diff --git a/src/model/invite.rs b/src/model/invite.rs index 22b851c3e88..eb942c3430c 100644 --- a/src/model/invite.rs +++ b/src/model/invite.rs @@ -397,7 +397,7 @@ pub struct InviteStageInstance { /// The number of users speaking in the Stage pub speaker_count: u64, /// The topic of the Stage instance (1-120 characters) - pub topic: FixedString, + pub topic: FixedString, } enum_number! { diff --git a/src/model/webhook.rs b/src/model/webhook.rs index ac3150b74fc..4f5d01948b8 100644 --- a/src/model/webhook.rs +++ b/src/model/webhook.rs @@ -102,7 +102,7 @@ pub struct WebhookGuild { /// The unique Id identifying the guild. pub id: GuildId, /// The name of the guild. - pub name: FixedString, + pub name: FixedString, /// The hash of the icon used by the guild. /// /// In the client, this appears on the guild list on the left-hand side. @@ -164,7 +164,7 @@ pub struct WebhookChannel { /// The unique Id of the channel. pub id: ChannelId, /// The name of the channel. - pub name: FixedString, + pub name: FixedString, } #[cfg(feature = "model")]