v7.4.1
What's Changed
- Add lending stream examples for
Group
types @yoshuawuyts in #151 - Fix insertion bug for
Group
types @yoshuawuyts in #151
Full Changelog: v7.4.0...v7.4.1
Example
use futures_concurrency::stream::StreamGroup;
use lending_stream::prelude::*;
use futures_lite::stream;
// Setup the stream group and populate it with one stream
let mut group = StreamGroup::new();
group.insert(stream::once(4));
let mut index = 3;
let mut out = 0;
let mut group = group.lend_mut();
while let Some((group, num)) = group.next().await {
if index != 0 {
// Update the group while iterating over the group's contents
group.insert(stream::once(index));
index -= 1;
}
out += num;
}
assert_eq!(out, 10);