aboutsummaryrefslogtreecommitdiff
path: root/src/framework/create_command.rs
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-08-16 22:16:13 +0200
committeracdenisSK <[email protected]>2017-08-16 22:18:09 +0200
commitbdb34b5dfe3153b5d9a2216a0af1b0250c878d28 (patch)
tree49e148b9a13ed46b2bb0f858d62a54b9818e7cfa /src/framework/create_command.rs
parentUse `#[serde(default)]` on `nsfw` instead (diff)
downloadserenity-bdb34b5dfe3153b5d9a2216a0af1b0250c878d28.tar.xz
serenity-bdb34b5dfe3153b5d9a2216a0af1b0250c878d28.zip
a little for-loop to iterator change
Also added .vscode to .gitignore, because it may or may not contain some stuff others wouldn't want when they're coding in it.
Diffstat (limited to 'src/framework/create_command.rs')
-rw-r--r--src/framework/create_command.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/framework/create_command.rs b/src/framework/create_command.rs
index d2ae31f..495fdd6 100644
--- a/src/framework/create_command.rs
+++ b/src/framework/create_command.rs
@@ -11,9 +11,7 @@ pub struct CreateCommand(pub Command);
impl CreateCommand {
/// Adds multiple aliases.
pub fn batch_known_as(mut self, names: Vec<&str>) -> Self {
- for n in names {
- self.0.aliases.push(n.to_owned());
- }
+ self.0.aliases.extend(names.into_iter().map(|n| n.to_owned()));
self
}