Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the flexibility of unfold #260

Closed
aweinstock314 opened this issue Nov 23, 2016 · 3 comments
Closed

Increase the flexibility of unfold #260

aweinstock314 opened this issue Nov 23, 2016 · 3 comments

Comments

@aweinstock314
Copy link

16:58:55 <aweinstock> Is there a compelling reason for unfold's step function to be (State -> Option<IntoFuture<Item=(StreamItem, State)>> rather than (State -> IntoFuture<Item=Option<(StreamItem, State)>>)?
16:59:43 <aweinstock> The flexibility to choose whether or not to yield the next item in the continuation of a future is helpful (perhaps necessary?) in some cases
16:59:58 <acrichto> hm yeah good point, makes sense to me!
17:00:02 <acrichto> want to open an issue w/ that?
17:00:12 <acrichto> unfortunately it'll have to wait until 0.2 at this point, but I can be sure we include it
17:00:32 <aweinstock> will do
17:00:50 <aweinstock> (I'm currently using my own version of unfold in https://github.com/aweinstock314/kingr4_weinsa_distributedsystems_project2/blob/master/src/main.rs#L302-L322 due to this)
17:01:38 <acrichto> yeah putting the option in the future makes sense to me
@carllerche
Copy link
Member

Is there an action item to take from here? This issue has been inactive for over a year now.

@sfackler
Copy link
Member

I think the action is to change the signature of unfold in 0.2.

alexcrichton added a commit that referenced this issue Feb 9, 2018
Move the `Option` to the result of the future, rather than immediately returning
an option of a future.

Closes #260
@alexcrichton
Copy link
Member

Fixed in #746 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants