diff options
| author | François Triquet <[email protected]> | 2017-10-04 08:41:54 +0200 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-10-09 15:47:48 -0700 |
| commit | b14650193342297746f985f8794e4b93ceeac52b (patch) | |
| tree | e43c3b95c22746e7b9ef26cdc9431326a3b384c8 /src/framework/standard/create_command.rs | |
| parent | Force `I` to be not implemented outside serenity (diff) | |
| download | serenity-b14650193342297746f985f8794e4b93ceeac52b.tar.xz serenity-b14650193342297746f985f8794e4b93ceeac52b.zip | |
Replace Vec parameters by IntoIterator (#176)
Diffstat (limited to 'src/framework/standard/create_command.rs')
| -rw-r--r-- | src/framework/standard/create_command.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/framework/standard/create_command.rs b/src/framework/standard/create_command.rs index 40877b9..e4665e8 100644 --- a/src/framework/standard/create_command.rs +++ b/src/framework/standard/create_command.rs @@ -9,7 +9,7 @@ pub struct CreateCommand(pub Command); impl CreateCommand { /// Adds multiple aliases. - pub fn batch_known_as(mut self, names: Vec<&str>) -> Self { + pub fn batch_known_as<T: ToString, It: IntoIterator<Item=T>>(mut self, names: It) -> Self { self.0 .aliases .extend(names.into_iter().map(|n| n.to_string())); @@ -208,8 +208,8 @@ impl CreateCommand { } /// Sets roles that are allowed to use the command. - pub fn allowed_roles(mut self, allowed_roles: Vec<&str>) -> Self { - self.0.allowed_roles = allowed_roles.iter().map(|x| x.to_string()).collect(); + pub fn allowed_roles<T: ToString, It: IntoIterator<Item=T>>(mut self, allowed_roles: It) -> Self { + self.0.allowed_roles = allowed_roles.into_iter().map(|x| x.to_string()).collect(); self } |