Skip to content

Commit

Permalink
create_stream -> stream_fn
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Oct 8, 2024
1 parent 73e9cd4 commit 806dd90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Features:
use futures_lite::stream;
use std::pin::pin;

let stream = pin!(asynk_strim::strim_fn(|mut yielder| async move {
let stream = pin!(asynk_strim::stream_fn(|mut yielder| async move {
yielder.yield_item("hello world!").await;
yielder.yield_item("pretty neato, ain't it?").await;
}));
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ where
/// }
/// # });
#[inline]
pub fn create_stream<F, Item, Fut>(func: F) -> impl Stream<Item = Item>
pub fn stream_fn<F, Item, Fut>(func: F) -> impl Stream<Item = Item>
where
F: FnOnce(Yielder<Item>) -> Fut,
Fut: Future<Output = ()>,
Expand All @@ -83,5 +83,5 @@ where
F: FnOnce(Yielder<Item>) -> Fut,
Fut: Future<Output = ()>,
{
create_stream(func)
stream_fn(func)
}

0 comments on commit 806dd90

Please sign in to comment.