Skip to content

Using Repeat in seq! or a better way to do what im trying to do #615

Answered by epage
SelectSweet asked this question in Q&A
Discussion options

You must be logged in to vote

repeats output is generic but take() ignores the output and provides a different one, so the compiler can't determine what type to use for repeat. Adding a type annotation to res doesn't work because a map operation happens. map doesn't work because that is appying to another take().

What you can do is repeat(...).map(|()| ()).take()

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@SelectSweet
Comment options

@epage
Comment options

Answer selected by SelectSweet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants