From 5de404ddd9484c6e1113697d749524ac79d8c763 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 16 Jan 2020 07:01:25 +0100 Subject: Take `IntoIterator` instead of `Iterator` --- core/src/command.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core/src/command.rs') diff --git a/core/src/command.rs b/core/src/command.rs index 1172976f..e7885fb8 100644 --- a/core/src/command.rs +++ b/core/src/command.rs @@ -65,9 +65,12 @@ impl Command { /// Once this command is run, all the commands will be exectued at once. /// /// [`Command`]: struct.Command.html - pub fn batch(commands: impl Iterator>) -> Self { + pub fn batch(commands: impl IntoIterator>) -> Self { Self { - futures: commands.flat_map(|command| command.futures).collect(), + futures: commands + .into_iter() + .flat_map(|command| command.futures) + .collect(), } } -- cgit