diff --git a/README.md b/README.md index 0803caa..3db8270 100644 --- a/README.md +++ b/README.md @@ -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; })); diff --git a/src/lib.rs b/src/lib.rs index 3bfde63..0052032 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -66,7 +66,7 @@ where /// } /// # }); #[inline] -pub fn create_stream(func: F) -> impl Stream +pub fn stream_fn(func: F) -> impl Stream where F: FnOnce(Yielder) -> Fut, Fut: Future, @@ -83,5 +83,5 @@ where F: FnOnce(Yielder) -> Fut, Fut: Future, { - create_stream(func) + stream_fn(func) }