diff options
| author | acdenisSK <[email protected]> | 2017-10-01 21:59:33 +0200 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-10-09 15:46:37 -0700 |
| commit | 0ce8be869eeb2eb700e22f71b2e00872cc96a500 (patch) | |
| tree | 03dd981bc04ba8475333d057705820c3320e3a97 /src/builder/edit_role.rs | |
| parent | Have `ConnectionStage` derive Copy (diff) | |
| download | serenity-0ce8be869eeb2eb700e22f71b2e00872cc96a500.tar.xz serenity-0ce8be869eeb2eb700e22f71b2e00872cc96a500.zip | |
`to_owned` -> `to_string`
Diffstat (limited to 'src/builder/edit_role.rs')
| -rw-r--r-- | src/builder/edit_role.rs | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/builder/edit_role.rs b/src/builder/edit_role.rs index 8be3404..0ef1b35 100644 --- a/src/builder/edit_role.rs +++ b/src/builder/edit_role.rs @@ -51,26 +51,26 @@ impl EditRole { #[cfg(feature = "utils")] { map.insert( - "color".to_owned(), + "color".to_string(), Value::Number(Number::from(role.colour.0)), ); } #[cfg(not(feature = "utils"))] { - map.insert("color".to_owned(), Value::Number(Number::from(role.colour))); + map.insert("color".to_string(), Value::Number(Number::from(role.colour))); } - map.insert("hoist".to_owned(), Value::Bool(role.hoist)); - map.insert("managed".to_owned(), Value::Bool(role.managed)); - map.insert("mentionable".to_owned(), Value::Bool(role.mentionable)); - map.insert("name".to_owned(), Value::String(role.name.clone())); + map.insert("hoist".to_string(), Value::Bool(role.hoist)); + map.insert("managed".to_string(), Value::Bool(role.managed)); + map.insert("mentionable".to_string(), Value::Bool(role.mentionable)); + map.insert("name".to_string(), Value::String(role.name.clone())); map.insert( - "permissions".to_owned(), + "permissions".to_string(), Value::Number(Number::from(role.permissions.bits())), ); map.insert( - "position".to_owned(), + "position".to_string(), Value::Number(Number::from(role.position)), ); @@ -80,7 +80,7 @@ impl EditRole { /// Sets the colour of the role. pub fn colour(mut self, colour: u64) -> Self { self.0 - .insert("color".to_owned(), Value::Number(Number::from(colour))); + .insert("color".to_string(), Value::Number(Number::from(colour))); self } @@ -88,7 +88,7 @@ impl EditRole { /// Whether or not to hoist the role above lower-positioned role in the user /// list. pub fn hoist(mut self, hoist: bool) -> Self { - self.0.insert("hoist".to_owned(), Value::Bool(hoist)); + self.0.insert("hoist".to_string(), Value::Bool(hoist)); self } @@ -96,7 +96,7 @@ impl EditRole { /// Whether or not to make the role mentionable, notifying its users. pub fn mentionable(mut self, mentionable: bool) -> Self { self.0 - .insert("mentionable".to_owned(), Value::Bool(mentionable)); + .insert("mentionable".to_string(), Value::Bool(mentionable)); self } @@ -104,7 +104,7 @@ impl EditRole { /// The name of the role to set. pub fn name(mut self, name: &str) -> Self { self.0 - .insert("name".to_owned(), Value::String(name.to_owned())); + .insert("name".to_string(), Value::String(name.to_string())); self } @@ -112,7 +112,7 @@ impl EditRole { /// The set of permissions to assign the role. pub fn permissions(mut self, permissions: Permissions) -> Self { self.0.insert( - "permissions".to_owned(), + "permissions".to_string(), Value::Number(Number::from(permissions.bits())), ); @@ -123,7 +123,7 @@ impl EditRole { /// role's position in the user list. pub fn position(mut self, position: u8) -> Self { self.0 - .insert("position".to_owned(), Value::Number(Number::from(position))); + .insert("position".to_string(), Value::Number(Number::from(position))); self } @@ -146,12 +146,12 @@ impl Default for EditRole { let mut map = Map::new(); let permissions = Number::from(permissions::PRESET_GENERAL.bits()); - map.insert("color".to_owned(), Value::Number(Number::from(10_070_709))); - map.insert("hoist".to_owned(), Value::Bool(false)); - map.insert("mentionable".to_owned(), Value::Bool(false)); - map.insert("name".to_owned(), Value::String("new role".to_owned())); - map.insert("permissions".to_owned(), Value::Number(permissions)); - map.insert("position".to_owned(), Value::Number(Number::from(1))); + map.insert("color".to_string(), Value::Number(Number::from(10_070_709))); + map.insert("hoist".to_string(), Value::Bool(false)); + map.insert("mentionable".to_string(), Value::Bool(false)); + map.insert("name".to_string(), Value::String("new role".to_string())); + map.insert("permissions".to_string(), Value::Number(permissions)); + map.insert("position".to_string(), Value::Number(Number::from(1))); EditRole(map) } |