diff options
| author | François Triquet <[email protected]> | 2017-10-05 14:03:18 +0200 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-10-09 15:48:18 -0700 |
| commit | 934eb3aa0b1f9c0aaad003627bd65932114654c1 (patch) | |
| tree | e2368797562580a6777c04ca19af567186b30ca4 /src/gateway | |
| parent | Fix most clippy warnings (diff) | |
| download | serenity-934eb3aa0b1f9c0aaad003627bd65932114654c1.tar.xz serenity-934eb3aa0b1f9c0aaad003627bd65932114654c1.zip | |
Replace slice parametres by IntoIterator (#177)
Fixes #174
Diffstat (limited to 'src/gateway')
| -rw-r--r-- | src/gateway/shard.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gateway/shard.rs b/src/gateway/shard.rs index 2781e84..2c621b1 100644 --- a/src/gateway/shard.rs +++ b/src/gateway/shard.rs @@ -671,13 +671,14 @@ impl Shard { /// ../../model/event/enum.Event.html#variant.GuildMembersChunk /// [`Guild`]: ../../model/struct.Guild.html /// [`Member`]: ../../model/struct.Member.html - pub fn chunk_guilds(&mut self, guild_ids: &[GuildId], limit: Option<u16>, query: Option<&str>) { + pub fn chunk_guilds<'a, It>(&mut self, guild_ids: It, limit: Option<u16>, query: Option<&str>) + where It: IntoIterator<Item=&'a GuildId>{ debug!("[Shard {:?}] Requesting member chunks", self.shard_info); let msg = json!({ "op": OpCode::GetGuildMembers.num(), "d": { - "guild_id": guild_ids.iter().map(|x| x.0).collect::<Vec<u64>>(), + "guild_id": guild_ids.into_iter().map(|x| x.0).collect::<Vec<u64>>(), "limit": limit.unwrap_or(0), "query": query.unwrap_or(""), }, |