Take IntoIterator instead of Iterator
This commit is contained in:
parent
a508b007d8
commit
5de404ddd9
@ -65,9 +65,12 @@ impl<T> Command<T> {
|
|||||||
/// Once this command is run, all the commands will be exectued at once.
|
/// Once this command is run, all the commands will be exectued at once.
|
||||||
///
|
///
|
||||||
/// [`Command`]: struct.Command.html
|
/// [`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 {
|
Self {
|
||||||
futures: commands.flat_map(|command| command.futures).collect(),
|
futures: commands
|
||||||
|
.into_iter()
|
||||||
|
.flat_map(|command| command.futures)
|
||||||
|
.collect(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,10 +50,11 @@ where
|
|||||||
///
|
///
|
||||||
/// [`Subscription`]: struct.Subscription.html
|
/// [`Subscription`]: struct.Subscription.html
|
||||||
pub fn batch(
|
pub fn batch(
|
||||||
subscriptions: impl Iterator<Item = Subscription<H, I, O>>,
|
subscriptions: impl IntoIterator<Item = Subscription<H, I, O>>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
recipes: subscriptions
|
recipes: subscriptions
|
||||||
|
.into_iter()
|
||||||
.flat_map(|subscription| subscription.recipes)
|
.flat_map(|subscription| subscription.recipes)
|
||||||
.collect(),
|
.collect(),
|
||||||
}
|
}
|
||||||
|
|||||||
@ -176,7 +176,7 @@ where
|
|||||||
&mut self,
|
&mut self,
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
clipboard: Option<&dyn Clipboard>,
|
clipboard: Option<&dyn Clipboard>,
|
||||||
events: impl Iterator<Item = Event>,
|
events: impl IntoIterator<Item = Event>,
|
||||||
) -> Vec<Message> {
|
) -> Vec<Message> {
|
||||||
let mut messages = Vec::new();
|
let mut messages = Vec::new();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user