Skip to content

Conversation

justin1dennison
Copy link

I have started working on the from_fn free function. However, I may need a little guidance in the implementation. I tried to smoke test the function, but was not able to get the smoke test to ever complete.

src/from_fn.rs Outdated
// let mut output = vec![];

// let mut stream = crate::from_fn(|| async move {
// Some(1u8)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your f must return None eventually, otherwise it will not terminate. See the example here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Thegaram. I don't know what I was thinking.

@justin1dennison justin1dennison changed the title [WIP] Implementing from_fn Implementing from_fn Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants