Skip to content

Commit 5090d72

Browse files
committed
FixedString::into_string -> Into::into
1 parent 01a62f5 commit 5090d72

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

src/builder/create_embed.rs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
1717
use std::borrow::Cow;
1818

19-
#[cfg(feature = "http")]
20-
use crate::internal::prelude::*;
2119
use crate::model::prelude::*;
2220

2321
/// A builder to create an embed in a message
@@ -247,16 +245,16 @@ impl From<Embed> for CreateEmbed<'_> {
247245
fn from(embed: Embed) -> Self {
248246
Self {
249247
fields: embed.fields.into_iter().map(Into::into).collect(),
250-
description: embed.description.map(FixedString::into_string).map(Into::into),
248+
description: embed.description.map(Into::into),
251249
thumbnail: embed.thumbnail.map(Into::into),
252250
timestamp: embed.timestamp,
253251
kind: Some("rich"),
254252
author: embed.author.map(Into::into),
255253
colour: embed.colour,
256254
footer: embed.footer.map(Into::into),
257255
image: embed.image.map(Into::into),
258-
title: embed.title.map(FixedString::into_string).map(Into::into),
259-
url: embed.url.map(FixedString::into_string).map(Into::into),
256+
title: embed.title.map(Into::into),
257+
url: embed.url.map(Into::into),
260258
}
261259
}
262260
}
@@ -302,9 +300,9 @@ impl<'a> CreateEmbedAuthor<'a> {
302300
impl From<EmbedAuthor> for CreateEmbedAuthor<'_> {
303301
fn from(author: EmbedAuthor) -> Self {
304302
Self {
305-
name: author.name.into_string().into(),
306-
url: author.url.map(|f| f.into_string().into()),
307-
icon_url: author.icon_url.map(|f| f.into_string().into()),
303+
name: author.name.into(),
304+
url: author.url.map(Into::into),
305+
icon_url: author.icon_url.map(Into::into),
308306
}
309307
}
310308
}
@@ -360,8 +358,8 @@ impl<'a> CreateEmbedFooter<'a> {
360358
impl From<EmbedFooter> for CreateEmbedFooter<'_> {
361359
fn from(footer: EmbedFooter) -> Self {
362360
Self {
363-
text: footer.text.into_string().into(),
364-
icon_url: footer.icon_url.map(|f| f.into_string().into()),
361+
text: footer.text.into(),
362+
icon_url: footer.icon_url.map(Into::into),
365363
}
366364
}
367365
}
@@ -386,8 +384,8 @@ impl<'a> From<&'a EmbedField> for CreateEmbedField<'a> {
386384
impl From<EmbedField> for CreateEmbedField<'_> {
387385
fn from(field: EmbedField) -> Self {
388386
Self {
389-
name: field.name.into_string().into(),
390-
value: field.value.into_string().into(),
387+
name: field.name.into(),
388+
value: field.value.into(),
391389
inline: field.inline,
392390
}
393391
}
@@ -401,15 +399,15 @@ struct CreateEmbedImage<'a> {
401399
impl From<EmbedImage> for CreateEmbedImage<'_> {
402400
fn from(field: EmbedImage) -> Self {
403401
Self {
404-
url: field.url.into_string().into(),
402+
url: field.url.into(),
405403
}
406404
}
407405
}
408406

409407
impl From<EmbedThumbnail> for CreateEmbedImage<'_> {
410408
fn from(field: EmbedThumbnail) -> Self {
411409
Self {
412-
url: field.url.into_string().into(),
410+
url: field.url.into(),
413411
}
414412
}
415413
}

src/builder/create_forum_tag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl<'a> CreateForumTag<'a> {
3939
},
4040
ReactionType::Unicode(unicode_emoji) => {
4141
self.emoji_id = None;
42-
self.emoji_name = Some(unicode_emoji.into_string().into());
42+
self.emoji_name = Some(unicode_emoji.into());
4343
},
4444
}
4545
self

src/gateway/client/dispatch.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use super::{Context, FullEvent};
66
use crate::cache::{Cache, CacheUpdate};
77
#[cfg(feature = "framework")]
88
use crate::framework::Framework;
9-
use crate::internal::prelude::*;
109
use crate::internal::tokio::spawn_named;
1110
use crate::model::channel::ChannelType;
1211
use crate::model::event::Event;
@@ -380,11 +379,11 @@ fn update_cache_with_event(
380379
}
381380
},
382381
Event::VoiceChannelStatusUpdate(mut event) => {
383-
let old = if_cache!(event.update(cache).map(FixedString::into_string));
382+
let old = if_cache!(event.update(cache).map(Into::into));
384383

385384
FullEvent::VoiceChannelStatusUpdate {
386385
old,
387-
status: event.status.map(FixedString::into_string),
386+
status: event.status.map(Into::into),
388387
id: event.id,
389388
guild_id: event.guild_id,
390389
}

0 commit comments

Comments
 (0)