aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-10-01 21:59:33 +0200
committerZeyla Hellyer <[email protected]>2017-10-09 15:46:37 -0700
commit0ce8be869eeb2eb700e22f71b2e00872cc96a500 (patch)
tree03dd981bc04ba8475333d057705820c3320e3a97 /src/model
parentHave `ConnectionStage` derive Copy (diff)
downloadserenity-0ce8be869eeb2eb700e22f71b2e00872cc96a500.tar.xz
serenity-0ce8be869eeb2eb700e22f71b2e00872cc96a500.zip
`to_owned` -> `to_string`
Diffstat (limited to 'src/model')
-rw-r--r--src/model/channel/channel_category.rs8
-rw-r--r--src/model/channel/guild_channel.rs8
-rw-r--r--src/model/channel/message.rs2
-rw-r--r--src/model/channel/reaction.rs2
-rw-r--r--src/model/event.rs2
-rw-r--r--src/model/gateway.rs6
-rw-r--r--src/model/guild/guild_id.rs2
-rw-r--r--src/model/guild/mod.rs4
-rw-r--r--src/model/invite.rs14
-rw-r--r--src/model/user.rs4
-rw-r--r--src/model/webhook.rs6
11 files changed, 29 insertions, 29 deletions
diff --git a/src/model/channel/channel_category.rs b/src/model/channel/channel_category.rs
index 50df35e..f567cee 100644
--- a/src/model/channel/channel_category.rs
+++ b/src/model/channel/channel_category.rs
@@ -94,14 +94,14 @@ impl ChannelCategory {
}
let mut map = Map::new();
- map.insert("name".to_owned(), Value::String(self.name.clone()));
+ map.insert("name".to_string(), Value::String(self.name.clone()));
map.insert(
- "position".to_owned(),
+ "position".to_string(),
Value::Number(Number::from(self.position)),
);
map.insert(
- "type".to_owned(),
- Value::String(self.kind.name().to_owned()),
+ "type".to_string(),
+ Value::String(self.kind.name().to_string()),
);
let edited = f(EditChannel(map)).0;
diff --git a/src/model/channel/guild_channel.rs b/src/model/channel/guild_channel.rs
index a6bc597..6cd3b72 100644
--- a/src/model/channel/guild_channel.rs
+++ b/src/model/channel/guild_channel.rs
@@ -313,14 +313,14 @@ impl GuildChannel {
}
let mut map = Map::new();
- map.insert("name".to_owned(), Value::String(self.name.clone()));
+ map.insert("name".to_string(), Value::String(self.name.clone()));
map.insert(
- "position".to_owned(),
+ "position".to_string(),
Value::Number(Number::from(self.position)),
);
map.insert(
- "type".to_owned(),
- Value::String(self.kind.name().to_owned()),
+ "type".to_string(),
+ Value::String(self.kind.name().to_string()),
);
let edited = f(EditChannel(map)).0;
diff --git a/src/model/channel/message.rs b/src/model/channel/message.rs
index 7b94540..55f61ba 100644
--- a/src/model/channel/message.rs
+++ b/src/model/channel/message.rs
@@ -257,7 +257,7 @@ impl Message {
self.content = if chosen.contains("$user") {
chosen.replace("$user", &self.author.mention())
} else {
- chosen.to_owned()
+ chosen.to_string()
};
},
_ => {},
diff --git a/src/model/channel/reaction.rs b/src/model/channel/reaction.rs
index 2420ba7..8edc2e9 100644
--- a/src/model/channel/reaction.rs
+++ b/src/model/channel/reaction.rs
@@ -274,7 +274,7 @@ impl<'a> From<&'a str> for ReactionType {
///
/// foo("🍎");
/// ```
- fn from(unicode: &str) -> ReactionType { ReactionType::Unicode(unicode.to_owned()) }
+ fn from(unicode: &str) -> ReactionType { ReactionType::Unicode(unicode.to_string()) }
}
impl Display for ReactionType {
diff --git a/src/model/event.rs b/src/model/event.rs
index 6e54a25..f729a33 100644
--- a/src/model/event.rs
+++ b/src/model/event.rs
@@ -578,7 +578,7 @@ impl<'de> Deserialize<'de> for GuildMembersChunkEvent {
for member in members {
if let Some(map) = member.as_object_mut() {
- map.insert("guild_id".to_owned(), num.clone());
+ map.insert("guild_id".to_string(), num.clone());
}
}
}
diff --git a/src/model/gateway.rs b/src/model/gateway.rs
index 4edf0b8..4edc20e 100644
--- a/src/model/gateway.rs
+++ b/src/model/gateway.rs
@@ -60,7 +60,7 @@ impl Game {
pub fn playing(name: &str) -> Game {
Game {
kind: GameType::Playing,
- name: name.to_owned(),
+ name: name.to_string(),
url: None,
}
}
@@ -91,8 +91,8 @@ impl Game {
pub fn streaming(name: &str, url: &str) -> Game {
Game {
kind: GameType::Streaming,
- name: name.to_owned(),
- url: Some(url.to_owned()),
+ name: name.to_string(),
+ url: Some(url.to_string()),
}
}
}
diff --git a/src/model/guild/guild_id.rs b/src/model/guild/guild_id.rs
index 39b7dbb..4b9a713 100644
--- a/src/model/guild/guild_id.rs
+++ b/src/model/guild/guild_id.rs
@@ -374,7 +374,7 @@ impl GuildId {
where C: Into<ChannelId>, U: Into<UserId> {
let mut map = Map::new();
map.insert(
- "channel_id".to_owned(),
+ "channel_id".to_string(),
Value::Number(Number::from(channel_id.into().0)),
);
diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs
index cec9e63..eef9d73 100644
--- a/src/model/guild/mod.rs
+++ b/src/model/guild/mod.rs
@@ -1073,7 +1073,7 @@ impl<'de> Deserialize<'de> for Guild {
for value in array {
if let Some(channel) = value.as_object_mut() {
channel
- .insert("guild_id".to_owned(), Value::Number(Number::from(guild_id)));
+ .insert("guild_id".to_string(), Value::Number(Number::from(guild_id)));
}
}
}
@@ -1082,7 +1082,7 @@ impl<'de> Deserialize<'de> for Guild {
for value in array {
if let Some(member) = value.as_object_mut() {
member
- .insert("guild_id".to_owned(), Value::Number(Number::from(guild_id)));
+ .insert("guild_id".to_string(), Value::Number(Number::from(guild_id)));
}
}
}
diff --git a/src/model/invite.rs b/src/model/invite.rs
index ba7521a..b4f326c 100644
--- a/src/model/invite.rs
+++ b/src/model/invite.rs
@@ -126,16 +126,16 @@ impl Invite {
/// # let invite = Invite {
/// # approximate_member_count: Some(1812),
/// # approximate_presence_count: Some(717),
- /// # code: "WxZumR".to_owned(),
+ /// # code: "WxZumR".to_string(),
/// # channel: InviteChannel {
/// # id: ChannelId(1),
- /// # name: "foo".to_owned(),
+ /// # name: "foo".to_string(),
/// # kind: ChannelType::Text,
/// # },
/// # guild: InviteGuild {
/// # id: GuildId(2),
/// # icon: None,
- /// # name: "bar".to_owned(),
+ /// # name: "bar".to_string(),
/// # splash_hash: None,
/// # text_channel_count: Some(7),
/// # voice_channel_count: Some(3),
@@ -290,17 +290,17 @@ impl RichInvite {
/// # use serenity::model::*;
/// #
/// # let invite = RichInvite {
- /// # code: "WxZumR".to_owned(),
+ /// # code: "WxZumR".to_string(),
/// # channel: InviteChannel {
/// # id: ChannelId(1),
- /// # name: "foo".to_owned(),
+ /// # name: "foo".to_string(),
/// # kind: ChannelType::Text,
/// # },
/// # created_at: "2017-01-29T15:35:17.136000+00:00".parse().unwrap(),
/// # guild: InviteGuild {
/// # id: GuildId(2),
/// # icon: None,
- /// # name: "baz".to_owned(),
+ /// # name: "baz".to_string(),
/// # splash_hash: None,
/// # text_channel_count: None,
/// # voice_channel_count: None,
@@ -310,7 +310,7 @@ impl RichInvite {
/// # bot: false,
/// # discriminator: 3,
/// # id: UserId(4),
- /// # name: "qux".to_owned(),
+ /// # name: "qux".to_string(),
/// # },
/// # max_age: 5,
/// # max_uses: 6,
diff --git a/src/model/user.rs b/src/model/user.rs
index b28997f..3ae33aa 100644
--- a/src/model/user.rs
+++ b/src/model/user.rs
@@ -85,10 +85,10 @@ impl CurrentUser {
pub fn edit<F>(&mut self, f: F) -> Result<()>
where F: FnOnce(EditProfile) -> EditProfile {
let mut map = Map::new();
- map.insert("username".to_owned(), Value::String(self.name.clone()));
+ map.insert("username".to_string(), Value::String(self.name.clone()));
if let Some(email) = self.email.as_ref() {
- map.insert("email".to_owned(), Value::String(email.clone()));
+ map.insert("email".to_string(), Value::String(email.clone()));
}
match http::edit_profile(&f(EditProfile(map)).0) {
diff --git a/src/model/webhook.rs b/src/model/webhook.rs
index 5e10d90..c8ae1b0 100644
--- a/src/model/webhook.rs
+++ b/src/model/webhook.rs
@@ -108,17 +108,17 @@ impl Webhook {
if let Some(avatar) = avatar {
map.insert(
- "avatar".to_owned(),
+ "avatar".to_string(),
if avatar.is_empty() {
Value::Null
} else {
- Value::String(avatar.to_owned())
+ Value::String(avatar.to_string())
},
);
}
if let Some(name) = name {
- map.insert("name".to_owned(), Value::String(name.to_owned()));
+ map.insert("name".to_string(), Value::String(name.to_string()));
}
match http::edit_webhook_with_token(self.id.0, &self.token, &map) {