From bdb34b5dfe3153b5d9a2216a0af1b0250c878d28 Mon Sep 17 00:00:00 2001 From: acdenisSK Date: Wed, 16 Aug 2017 22:16:13 +0200 Subject: 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. --- src/framework/create_command.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/framework/create_command.rs') 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 } -- cgit v1.2.3