summaryrefslogtreecommitdiffstats
path: root/core/src/command.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/command.rs')
-rw-r--r--core/src/command.rs7
1 files changed, 5 insertions, 2 deletions
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<T> Command<T> {
/// Once this command is run, all the commands will be exectued at once.
///
/// [`Command`]: struct.Command.html
- pub fn batch(commands: impl Iterator<Item = Command<T>>) -> Self {
+ pub fn batch(commands: impl IntoIterator<Item = Command<T>>) -> Self {
Self {
- futures: commands.flat_map(|command| command.futures).collect(),
+ futures: commands
+ .into_iter()
+ .flat_map(|command| command.futures)
+ .collect(),
}
}